Fix UglifyJS configuration to add "use strict".
Review Request #14963 — Created March 26, 2026 and submitted — Latest diff uploaded
UglifyJS 3.18.0 changed their default for the
modulesetting, which
made the resulting output no longer contain "use strict" at the
beginning of the IIFE. It also has a long-standing bug where code like
this:function(attributes, options) { var attrs = attributes || {}; ... something(arguments); }gets converted to this:
function(a, b) { var a = a || {}; ... something(arguments); }Unfortunately, by reusing the same variable name for
a, when running
in non-strict mode, this aliasesarguments, causing the value of
arguments[0]that gets passed in tosomethingto be whateverais
instead of the originalarguments.This change adds in
--no-moduleto the UglifyJS arguments, restoring
the behavior that we previously saw in older builds.
- Built static media and verified that the emitted code had "use
strict". - Copied resulting minified files into a (previously broken) Review
Board 7.0.5 container and verified that the bugs we saw were fixed.