diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-12-17 23:16:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-18 07:16:04 +0800 |
commit | 2c637fea8a4a2023e8ff0ac9211f266580bdce85 (patch) | |
tree | af05da35d543088fbf12570502df0cd0c4852b90 /lib | |
parent | 4fa54b075c4507901fd3750e8fc7834cf7e9c809 (diff) | |
download | tracifyjs-2c637fea8a4a2023e8ff0ac9211f266580bdce85.tar.gz tracifyjs-2c637fea8a4a2023e8ff0ac9211f266580bdce85.zip |
fix corner case in `evaluate` & `reduce_vars` (#4394)
fixes #4393
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compress.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js index fa59ef5e..b8f4b3a5 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -426,6 +426,9 @@ merge(Compressor.prototype, { } }); }; + if (scope.uses_arguments) scope.each_argname(function(node) { + node.definition().last_ref = false; + }); if (compressor.option("ie8")) scope.variables.each(function(def) { var d = def.orig[0].definition(); if (d !== def) d.fixed = false; @@ -479,7 +482,7 @@ merge(Compressor.prototype, { function push_ref(def, ref) { def.references.push(ref); - def.last_ref = ref; + if (def.last_ref !== false) def.last_ref = ref; } function safe_to_read(tw, def) { |