fix corner case in inline (#5664)

fixes #5662
This commit is contained in:
Alex Lam S.L
2022-09-17 01:54:54 +01:00
committed by GitHub
parent e0b302d651
commit 001f6f9719
3 changed files with 44 additions and 8 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 && !(parent instanceof U.AST_Const)) {
if (node.value && !(node.name instanceof U.AST_Destructured || parent instanceof U.AST_Const)) {
node.start._permute++;
CHANGED = true;
return new U.AST_VarDef({