From 353f654038381bc96a7cb770013e0b52b10694e6 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Mon, 8 Feb 2021 11:16:21 +0000 Subject: [PATCH] fix corner case in `--reduce-test` (#4625) --- test/reduce.js | 1 + 1 file changed, 1 insertion(+) 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 ...) -- 2.34.1