diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-02-08 11:16:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-08 19:16:21 +0800 |
commit | 353f654038381bc96a7cb770013e0b52b10694e6 (patch) | |
tree | d8964efcf8f1c6254557b738405607b1d2e1f711 /test/reduce.js | |
parent | 357d8612462c826f9e0e85b4d3a1c790f6de7057 (diff) | |
download | tracifyjs-353f654038381bc96a7cb770013e0b52b10694e6.tar.gz tracifyjs-353f654038381bc96a7cb770013e0b52b10694e6.zip |
fix corner case in `--reduce-test` (#4625)
Diffstat (limited to 'test/reduce.js')
-rw-r--r-- | test/reduce.js | 1 |
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 ...) |