fix corner case in --reduce-test (#4625)

This commit is contained in:
Alex Lam S.L
2021-02-08 11:16:21 +00:00
committed by GitHub
parent 357d861246
commit 353f654038

View File

@@ -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 ...)