fix corner cases in if_return (#5585)

fixes #5583
fixes #5584
fixes #5586
This commit is contained in:
Alex Lam S.L
2022-07-30 09:07:19 +01:00
committed by GitHub
parent 08c386f363
commit ab5c7e6863
3 changed files with 277 additions and 13 deletions

View File

@@ -466,7 +466,7 @@ module.exports = function reduce_test(testcase, minify_options, reduce_options)
}
}
else if (node instanceof U.AST_VarDef) {
if (node.value) {
if (node.value && !(parent instanceof U.AST_Const)) {
node.start._permute++;
CHANGED = true;
return new U.AST_VarDef({