aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-12-04 20:24:55 +0800
committerGitHub <noreply@github.com>2019-12-04 20:24:55 +0800
commitd68ddc31f94074e09c661cb79ea43cef9adb44e6 (patch)
tree5b46e937fe694f31e7c8acc5e5d395eb230544d9 /lib
parent500e31e03b69d3c6fa219a74f9131c2abc9c9730 (diff)
downloadtracifyjs-d68ddc31f94074e09c661cb79ea43cef9adb44e6.tar.gz
tracifyjs-d68ddc31f94074e09c661cb79ea43cef9adb44e6.zip
fix corner case in `reduce_vars` (#3623)
fixes #3622
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index e18fd575..4442bbb5 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -701,8 +701,11 @@ merge(Compressor.prototype, {
node.argnames.forEach(function(arg, i) {
var d = arg.definition();
if (d.fixed === undefined && (!node.uses_arguments || tw.has_directive("use strict"))) {
+ var value = iife.args[i];
d.fixed = function() {
- return iife.args[i] || make_node(AST_Undefined, iife);
+ var j = node.argnames.indexOf(arg);
+ if (j < 0) return value;
+ return iife.args[j] || make_node(AST_Undefined, iife);
};
tw.loop_ids[d.id] = tw.in_loop;
mark(tw, d, true);