Commit b9f682ba authored by nikolaos's avatar nikolaos Committed by Commit bot

Fix bug with illegal spread as single arrow parameter

R=adamk@chromium.org
BUG=chromium:621496
LOG=N

Review-Url: https://codereview.chromium.org/2084703005
Cr-Commit-Position: refs/heads/master@{#37196}
parent 04f710ac
......@@ -1592,8 +1592,11 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier,
MessageTemplate::kUnexpectedToken,
Token::String(Token::ELLIPSIS));
classifier->RecordNonSimpleParameter();
ExpressionT expr =
this->ParseAssignmentExpression(true, classifier, CHECK_OK);
ExpressionClassifier binding_classifier(this);
ExpressionT expr = this->ParseAssignmentExpression(
true, &binding_classifier, CHECK_OK);
classifier->Accumulate(&binding_classifier,
ExpressionClassifier::AllProductions);
if (!this->IsIdentifier(expr) && !IsValidPattern(expr)) {
classifier->RecordArrowFormalParametersError(
Scanner::Location(ellipsis_pos, scanner()->location().end_pos),
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(function testIllegalSpreadAsSingleArrowParameter() {
assertThrows("(...[42]) => 42)", SyntaxError) // will core dump, if not fixed
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment