Chromium Code Reviews| Index: src/parsing/parser-base.h |
| diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h |
| index 57bfb69937cf012d3500abe0b63a90fdfc76543f..1087488157beabcbcf1c6c36d4d239af031f314a 100644 |
| --- a/src/parsing/parser-base.h |
| +++ b/src/parsing/parser-base.h |
| @@ -2134,8 +2134,6 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParsePropertyName( |
| scanner()->location(), |
| MessageTemplate::kInvalidDestructuringTarget); |
| } else { |
| - // TODO(gsathya): Throw error if number of properties > |
| - // Code::kMaxArguments |
| CheckDestructuringElement(expression, pos, |
| scanner()->location().end_pos); |
| } |
| @@ -2595,6 +2593,11 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParseObjectLiteral( |
| // Computation of literal_index must happen before pre parse bailout. |
| int literal_index = function_state_->NextMaterializedLiteralIndex(); |
| + if (has_rest_property && properties->length() > Code::kMaxArguments) { |
| + this->classifier()->RecordPatternError(Scanner::Location(pos, position()), |
|
adamk
2017/01/23 21:47:45
Can you add a comment with a pointer to the code i
gsathya
2017/01/23 22:22:27
Done.
|
| + MessageTemplate::kTooManyArguments); |
| + } |
| + |
| return factory()->NewObjectLiteral(properties, literal_index, |
| number_of_boilerplate_properties, pos, |
| has_rest_property); |