aboutsummaryrefslogtreecommitdiff
path: root/test/reduce.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-02-08 11:16:21 +0000
committerGitHub <noreply@github.com>2021-02-08 19:16:21 +0800
commit353f654038381bc96a7cb770013e0b52b10694e6 (patch)
treed8964efcf8f1c6254557b738405607b1d2e1f711 /test/reduce.js
parent357d8612462c826f9e0e85b4d3a1c790f6de7057 (diff)
downloadtracifyjs-353f654038381bc96a7cb770013e0b52b10694e6.tar.gz
tracifyjs-353f654038381bc96a7cb770013e0b52b10694e6.zip
fix corner case in `--reduce-test` (#4625)
Diffstat (limited to 'test/reduce.js')
-rw-r--r--test/reduce.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/reduce.js b/test/reduce.js
index 5f192aca..bfc0c173 100644
--- a/test/reduce.js
+++ b/test/reduce.js
@@ -131,6 +131,7 @@ module.exports = function reduce_test(testcase, minify_options, reduce_options)
case "delete":
return;
}
+ if (parent instanceof U.AST_VarDef && parent.name === node) return;
// preserve for (var xxx; ...)
if (parent instanceof U.AST_For && parent.init === node && node instanceof U.AST_Definitions) return node;
// preserve for (xxx in ...)