[parser] Only throw spread class property error if it's the first error

Bug: chromium:899474, v8:8363, v8:7926
Change-Id: I89680d35ab2557f5a2b2282813362f5f654862a9
Reviewed-on: https://chromium-review.googlesource.com/c/1304314
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57058}
This commit is contained in:
Toon Verwaest 2018-10-29 09:22:29 +01:00 committed by Commit Bot
parent bfe134a7db
commit dc70cb6694
2 changed files with 6 additions and 0 deletions

View File

@ -2306,6 +2306,7 @@ ParserBase<Impl>::ParseClassPropertyDefinition(
return result;
}
case ParsePropertyKind::kSpread:
RETURN_IF_PARSE_ERROR_CUSTOM(NullLiteralProperty);
ReportUnexpectedTokenAt(
Scanner::Location(name_token_position, name_expression->position()),
name_token);

View File

@ -0,0 +1,5 @@
// Copyright 2018 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.
assertThrows("class A {...", SyntaxError);