Skip to content

Commit 3e037e1

Browse files
sygV8 LUCI CQ
authored andcommitted
[parser] Using FunctionParsingScope for parsing class static blocks
Class static blocks contain statements, don't inherit the ExpressionScope stack. Bug: 341663589 Change-Id: Id52a60d77781201a706fcf2290d7d103f39bed83 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5553030 Commit-Queue: Shu-yu Guo <[email protected]> Commit-Queue: Adam Klein <[email protected]> Reviewed-by: Adam Klein <[email protected]> Cr-Commit-Position: refs/heads/main@{#94014}
1 parent bf4298b commit 3e037e1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/ast/scopes.cc

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

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)