Skip to content

Commit 3b1adc1

Browse files
verwaestV8 LUCI CQ
authored andcommitted
[parser] Fix parse errors in static computed class properties
Otherwise we'll try to rewrite a FailureExpression Bug: 366323452 Change-Id: Ief76a242a4b625762a496d9c8c816bc7156a9b37 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5872647 Commit-Queue: Toon Verwaest <[email protected]> Commit-Queue: Igor Sheludko <[email protected]> Reviewed-by: Igor Sheludko <[email protected]> Auto-Submit: Toon Verwaest <[email protected]> Cr-Commit-Position: refs/heads/main@{#96163}
1 parent 5c230bd commit 3b1adc1

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/parsing/parser-base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2676,7 +2676,7 @@ ParserBase<Impl>::ParseClassPropertyDefinition(ClassInfo* class_info,
26762676
DCHECK_IMPLIES(prop_info->is_computed_name, !prop_info->is_private);
26772677

26782678
if (prop_info->is_computed_name) {
2679-
if (next_info_id != PeekNextInfoId() &&
2679+
if (!has_error() && next_info_id != PeekNextInfoId() &&
26802680
!(prop_info->is_static ? class_info->has_static_elements()
26812681
: class_info->has_instance_members())) {
26822682
impl()->ReindexComputedMemberName(name_expression);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Copyright 2024 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
assertThrows(`new class {
6+
static [{aaa(){}];
7+
};`);

0 commit comments

Comments
 (0)