[ES6] fix parsing spread arguments that are expressions

This commit is contained in:
kzc
2016-09-29 13:25:17 -04:00
parent 13ed445607
commit 4198095a9c
2 changed files with 12 additions and 1 deletions

View File

@@ -2371,7 +2371,7 @@ function parse($TEXT, options) {
next();
args.push(new AST_Expansion({
start: prev(),
expression: as_symbol(AST_SymbolFunarg)
expression: expression(false)
}));
} else {
args.push(expression(false));

View File

@@ -7,6 +7,17 @@ expand_arguments: {
expect_exact: "func(a,...rest);func(...all);"
}
expand_expression_arguments: {
input: {
f(...a.b);
f(...a.b());
f(...(a));
f(...(a.b));
f(...a[i]);
}
expect_exact: "f(...a.b);f(...a.b());f(...a);f(...a.b);f(...a[i]);"
}
expand_parameters: {
input: {
(function (a, ...b){});