Skip to content

Commit 6e5e105

Browse files
sygV8 LUCI CQ
authored andcommitted
Merged: [parser] Using FunctionParsingScope for parsing class static blocks
Class static blocks contain statements, don't inherit the ExpressionScope stack. (cherry picked from commit 3e037e1) Bug: 341663589 Change-Id: Ice9a710293b028e5d9fd30d5d85c4842f970b152 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5558360 Reviewed-by: Adam Klein <[email protected]> Reviewed-by: Shu-yu Guo <[email protected]> Commit-Queue: Adam Klein <[email protected]> Cr-Commit-Position: refs/branch-heads/12.4@{#38} Cr-Branched-From: 309640d-refs/heads/12.4.254@{#1} Cr-Branched-From: 5dc2470-refs/heads/main@{#92862}
1 parent 24dba30 commit 6e5e105

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/ast/scopes.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2445,7 +2445,7 @@ bool Scope::MustAllocate(Variable* var) {
24452445
var->set_is_used();
24462446
if (inner_scope_calls_eval_ && !var->is_this()) var->SetMaybeAssigned();
24472447
}
2448-
DCHECK(!var->has_forced_context_allocation() || var->is_used());
2448+
CHECK(!var->has_forced_context_allocation() || var->is_used());
24492449
// Global variables do not need to be allocated.
24502450
return !var->IsGlobalObjectProperty() && var->is_used();
24512451
}

src/parsing/parser-base.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,6 +2661,7 @@ typename ParserBase<Impl>::BlockT ParserBase<Impl>::ParseClassStaticBlock(
26612661
}
26622662

26632663
FunctionState initializer_state(&function_state_, &scope_, initializer_scope);
2664+
FunctionParsingScope body_parsing_scope(impl());
26642665
AcceptINScope accept_in(this, true);
26652666

26662667
// Each static block has its own var and lexical scope, so make a new var

0 commit comments

Comments
 (0)