| Index: src/preparser.h
|
| diff --git a/src/preparser.h b/src/preparser.h
|
| index 9f586469583c5cc7681c6a78c8f3d05b7b3ed260..177dc488fc9b5b404f4676a8107143544e675483 100644
|
| --- a/src/preparser.h
|
| +++ b/src/preparser.h
|
| @@ -1175,6 +1175,11 @@ class PreParserFactory {
|
| int pos) {
|
| return PreParserExpression::Default();
|
| }
|
| + PreParserExpression NewArrayLiteral(PreParserExpressionList values,
|
| + int first_spread_index, int literal_index,
|
| + bool is_strong, int pos) {
|
| + return PreParserExpression::Default();
|
| + }
|
| PreParserExpression NewObjectLiteralProperty(PreParserExpression key,
|
| PreParserExpression value,
|
| ObjectLiteralProperty::Kind kind,
|
| @@ -2388,6 +2393,7 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseArrayLiteral(
|
| int pos = peek_position();
|
| typename Traits::Type::ExpressionList values =
|
| this->NewExpressionList(4, zone_);
|
| + int first_spread_index = -1;
|
| Expect(Token::LBRACK, CHECK_OK);
|
| while (peek() != Token::RBRACK) {
|
| bool seen_spread = false;
|
| @@ -2410,6 +2416,9 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseArrayLiteral(
|
| this->ParseAssignmentExpression(true, classifier, CHECK_OK);
|
| elem = factory()->NewSpread(argument, start_pos);
|
| seen_spread = true;
|
| + if (first_spread_index < 0) {
|
| + first_spread_index = values->length();
|
| + }
|
| } else {
|
| elem = this->ParseAssignmentExpression(true, classifier, CHECK_OK);
|
| }
|
| @@ -2426,7 +2435,7 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseArrayLiteral(
|
| // Update the scope information before the pre-parsing bailout.
|
| int literal_index = function_state_->NextMaterializedLiteralIndex();
|
|
|
| - return factory()->NewArrayLiteral(values, literal_index,
|
| + return factory()->NewArrayLiteral(values, first_spread_index, literal_index,
|
| is_strong(language_mode()), pos);
|
| }
|
|
|
|
|