aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-11-18 03:39:32 +0000
committerGitHub <noreply@github.com>2020-11-18 11:39:32 +0800
commit35283e5dd18bb2b3be46a25786e2e73e8a24a863 (patch)
tree0a35ecfeb7393416bf86bc9b215628cdc11659df /lib/compress.js
parent7a51c17ff0005ca3725c8afefe2f4086f4316ee2 (diff)
downloadtracifyjs-35283e5dd18bb2b3be46a25786e2e73e8a24a863.tar.gz
tracifyjs-35283e5dd18bb2b3be46a25786e2e73e8a24a863.zip
enhance `arguments` (#4296)
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index e05b6f28..2a8ba8a0 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -9572,13 +9572,14 @@ merge(Compressor.prototype, {
}
}
var parent = compressor.parent();
+ var assigned = is_lhs(compressor.self(), parent);
var def, fn, fn_parent;
if (compressor.option("arguments")
&& expr instanceof AST_SymbolRef
&& is_arguments(def = expr.definition())
&& prop instanceof AST_Number
&& (fn = expr.scope.resolve()) === find_lambda()
- && fn.uses_arguments !== "d") {
+ && !(assigned && fn.uses_arguments === "d")) {
var index = prop.value;
if (parent instanceof AST_UnaryPrefix && parent.operator == "delete") {
if (!def.deleted) def.deleted = [];
@@ -9616,7 +9617,7 @@ merge(Compressor.prototype, {
return sym;
}
}
- if (is_lhs(compressor.self(), parent)) return self;
+ if (assigned) return self;
if (compressor.option("sequences")
&& parent.TYPE != "Call"
&& !(parent instanceof AST_ForIn && parent.init === self)) {