fix corner case in arguments (#4396)

fixes #4395
This commit is contained in:
Alex Lam S.L
2020-12-18 00:41:13 +00:00
committed by GitHub
parent 2c637fea8a
commit c1256c399a
3 changed files with 30 additions and 1 deletions

View File

@@ -175,6 +175,12 @@ module.exports = function reduce_test(testcase, minify_options, reduce_options)
CHANGED = true;
return expr instanceof U.AST_Spread ? expr.expression : expr;
}
if (node.expression instanceof U.AST_Arrow && node.expression.value) {
var seq = node.args.slice();
seq.push(node.expression.value);
CHANGED = true;
return to_sequence(seq);
}
if (node.expression instanceof U.AST_Function) {
// hoist and return expressions from the IIFE function expression
var body = node.expression.body;