@@ -580,9 +580,12 @@ merge(Compressor.prototype, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function safe_to_assign(tw, def, declare) {
|
function safe_to_assign(tw, def, declare) {
|
||||||
if (!(declare || all(def.orig, function(sym) {
|
if (!declare) {
|
||||||
return !(sym instanceof AST_SymbolConst);
|
if (is_funarg(def) && def.scope.uses_arguments && !tw.has_directive("use strict")) return false;
|
||||||
}))) return false;
|
if (!all(def.orig, function(sym) {
|
||||||
|
return !(sym instanceof AST_SymbolConst);
|
||||||
|
})) return false;
|
||||||
|
}
|
||||||
if (def.fixed === undefined) return declare || all(def.orig, function(sym) {
|
if (def.fixed === undefined) return declare || all(def.orig, function(sym) {
|
||||||
return !(sym instanceof AST_SymbolLet);
|
return !(sym instanceof AST_SymbolLet);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7722,3 +7722,23 @@ issue_4943_2: {
|
|||||||
"bar",
|
"bar",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4949: {
|
||||||
|
options = {
|
||||||
|
reduce_vars: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(function f(a) {
|
||||||
|
a = 0;
|
||||||
|
console.log(a++, arguments[0]);
|
||||||
|
})(0);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(function(a) {
|
||||||
|
a = 0;
|
||||||
|
console.log(a++, arguments[0]);
|
||||||
|
})(0);
|
||||||
|
}
|
||||||
|
expect_stdout: "0 1"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user