[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:
parent
bfe134a7db
commit
dc70cb6694
@ -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);
|
||||
|
5
test/mjsunit/regress/regress-899474.js
Normal file
5
test/mjsunit/regress/regress-899474.js
Normal 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);
|
Loading…
Reference in New Issue
Block a user