aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-05-26 15:24:26 +0100
committerGitHub <noreply@github.com>2021-05-26 22:24:26 +0800
commite3798d9a76704498819cc380166d62f2c8a9ff36 (patch)
tree10dd5dd9c531bfe00161d2e634c6d1044750da15 /lib/compress.js
parentc8d10b7cdeeedf4241204e330602be974cdd529a (diff)
downloadtracifyjs-e3798d9a76704498819cc380166d62f2c8a9ff36.tar.gz
tracifyjs-e3798d9a76704498819cc380166d62f2c8a9ff36.zip
fix corner case in `arguments` (#4967)
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 08b0f0d1..4340c8cc 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -11543,15 +11543,15 @@ merge(Compressor.prototype, {
}
var parent = compressor.parent();
var assigned = is_lhs(compressor.self(), parent);
- var def, fn, fn_parent;
+ var def, fn, fn_parent, index;
if (compressor.option("arguments")
&& expr instanceof AST_SymbolRef
&& is_arguments(def = expr.definition())
&& !expr.in_arg
&& prop instanceof AST_Number
+ && Math.floor(index = prop.value) == index
&& (fn = def.scope) === find_lambda()
&& fn.uses_arguments < (assigned ? 2 : 3)) {
- var index = prop.value;
if (parent instanceof AST_UnaryPrefix && parent.operator == "delete") {
if (!def.deleted) def.deleted = [];
def.deleted[index] = true;