From 1ba14eb2740f4bced99d2fc0a325c4fb623aed20 Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Mon, 8 Feb 2021 17:17:06 +0800 Subject: [PATCH] fix corner case in `--reduce-test` --- 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 ...)