39 lines
1.5 KiB
Diff
39 lines
1.5 KiB
Diff
From f79f2d4458557b78e390276cd39f88941ea2d6a9 Mon Sep 17 00:00:00 2001
|
|
From: Shu-yu Guo <syg@chromium.org>
|
|
Date: Fri, 3 Jan 2025 17:32:00 +0800
|
|
Subject: [PATCH] [parser] Using FunctionParsingScope for parsing class static
|
|
|
|
---
|
|
deps/v8/src/ast/scopes.cc | 2 +-
|
|
deps/v8/src/parsing/parser-base.h | 1 +
|
|
2 files changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/deps/v8/src/ast/scopes.cc b/deps/v8/src/ast/scopes.cc
|
|
index cd8be1ca..1cbeaaca 100644
|
|
--- a/deps/v8/src/ast/scopes.cc
|
|
+++ b/deps/v8/src/ast/scopes.cc
|
|
@@ -2420,7 +2420,7 @@ bool Scope::MustAllocate(Variable* var) {
|
|
var->set_is_used();
|
|
if (inner_scope_calls_eval_ && !var->is_this()) var->SetMaybeAssigned();
|
|
}
|
|
- DCHECK(!var->has_forced_context_allocation() || var->is_used());
|
|
+ CHECK(!var->has_forced_context_allocation() || var->is_used());
|
|
// Global variables do not need to be allocated.
|
|
return !var->IsGlobalObjectProperty() && var->is_used();
|
|
}
|
|
diff --git a/deps/v8/src/parsing/parser-base.h b/deps/v8/src/parsing/parser-base.h
|
|
index cfba92d7..efefb37f 100644
|
|
--- a/deps/v8/src/parsing/parser-base.h
|
|
+++ b/deps/v8/src/parsing/parser-base.h
|
|
@@ -2611,6 +2611,7 @@ typename ParserBase<Impl>::BlockT ParserBase<Impl>::ParseClassStaticBlock(
|
|
}
|
|
|
|
FunctionState initializer_state(&function_state_, &scope_, initializer_scope);
|
|
+ FunctionParsingScope body_parsing_scope(impl());
|
|
AcceptINScope accept_in(this, true);
|
|
|
|
// Each static block has its own var and lexical scope, so make a new var
|
|
--
|
|
2.43.0
|
|
|