@@ -4805,10 +4805,11 @@ merge(Compressor.prototype, {
48054805 if (!all(fn.argnames, function(sym, index) {
48064806 if (sym instanceof AST_DefaultValue) {
48074807 if (!args) return false;
4808- if (args[index] !== undefined) return false;
4809- var value = sym.value._eval(compressor, ignore_side_effects, cached, depth);
4810- if (value === sym.value) return false;
4811- args[index] = value;
4808+ if (args[index] === undefined) {
4809+ var value = sym.value._eval(compressor, ignore_side_effects, cached, depth);
4810+ if (value === sym.value) return false;
4811+ args[index] = value;
4812+ }
48124813 sym = sym.name;
48134814 }
48144815 return !(sym instanceof AST_Destructured);
@@ -4842,6 +4843,9 @@ merge(Compressor.prototype, {
48424843 if (!args || all(fn.argnames, function(sym, i) {
48434844 return assign(sym, args[i]);
48444845 }) && !(fn.rest && !assign(fn.rest, args.slice(fn.argnames.length))) || ignore_side_effects) {
4846+ if (ignore_side_effects) fn.argnames.forEach(function(sym) {
4847+ if (sym instanceof AST_DefaultValue) sym.value.walk(scan_modified);
4848+ });
48454849 fn.evaluating = true;
48464850 val = val._eval(compressor, ignore_side_effects, cached, depth);
48474851 delete fn.evaluating;
0 commit comments