Skip to content

Commit

Permalink
deps: V8: cherry-pick 6e5e1053fa61
Browse files Browse the repository at this point in the history
Original commit message:

    Merged: [parser] Using FunctionParsingScope for parsing class static blocks

    Class static blocks contain statements, don't inherit the
    ExpressionScope stack.

    (cherry picked from commit 3e037e195e508dea045f5626862412e8f64fc919)

    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@{nodejs#38}
    Cr-Branched-From: 309640da62fae0485c7e4f64829627c92d53b35d-refs/heads/12.4.254@{nodejs#1}
    Cr-Branched-From: 5dc24701432278556a9829d27c532f974643e6df-refs/heads/main@{#92862}

Refs: v8/v8@6e5e105
  • Loading branch information
giancorderoortiz committed Sep 6, 2024
1 parent 0092358 commit 7d888ff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.37',
'v8_embedder_string': '-node.38',

##### V8 defaults for Node.js #####

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/ast/scopes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2397,7 +2397,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();
}
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/parsing/parser-base.h
Original file line number Diff line number Diff line change
Expand Up @@ -2562,6 +2562,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
Expand Down

0 comments on commit 7d888ff

Please sign in to comment.