diff --git a/common.gypi b/common.gypi index e063139a7d4662..54a8d930c4c062 100644 --- a/common.gypi +++ b/common.gypi @@ -39,7 +39,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.22', + 'v8_embedder_string': '-node.23', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/parsing/parser-base.h b/deps/v8/src/parsing/parser-base.h index 847774910a94a1..b12a27142c22a7 100644 --- a/deps/v8/src/parsing/parser-base.h +++ b/deps/v8/src/parsing/parser-base.h @@ -4108,6 +4108,7 @@ void ParserBase::ParseFunctionBody( inner_body.Rewind(); inner_body.Add(inner_block); inner_block->set_scope(inner_scope); + impl()->RecordBlockSourceRange(inner_block, scope()->end_position()); if (!impl()->HasCheckedSyntax()) { const AstRawString* conflict = inner_scope->FindVariableDeclaredIn( function_scope, VariableMode::kLastLexicalVariableMode); diff --git a/deps/v8/test/mjsunit/code-coverage-block-async.js b/deps/v8/test/mjsunit/code-coverage-block-async.js index 111be213b6837c..56845aac0127a3 100644 --- a/deps/v8/test/mjsunit/code-coverage-block-async.js +++ b/deps/v8/test/mjsunit/code-coverage-block-async.js @@ -119,4 +119,21 @@ new Foo().timeout().next(); // 0400 {"start":184,"end":302,"count":0}, {"start":158,"end":182,"count":1}] ); +TestCoverage( +"https://crbug.com/v8/9952", +` +async function test(foo) { // 0000 + return {bar}; // 0050 + // 0100 + function bar() { // 0150 + console.log("test"); // 0200 + } // 0250 +} // 0300 +test().then(r => r.bar()); // 0350 +%PerformMicrotaskCheckpoint(); // 0400`, +[{"start":0,"end":449,"count":1}, + {"start":0,"end":301,"count":1}, + {"start":152,"end":253,"count":1}, + {"start":362,"end":374,"count":1}]); + %DebugToggleBlockCoverage(false); diff --git a/deps/v8/test/mjsunit/code-coverage-block.js b/deps/v8/test/mjsunit/code-coverage-block.js index 6cf81bcce0a311..4b9221604ad8d0 100644 --- a/deps/v8/test/mjsunit/code-coverage-block.js +++ b/deps/v8/test/mjsunit/code-coverage-block.js @@ -1083,4 +1083,33 @@ TestCoverage( {"start":16,"end":33,"count":0}] ); +TestCoverage( +"https://crbug.com/v8/9952", +` +function test(foo = "foodef") { // 0000 + return {bar}; // 0050 + // 0100 + function bar() { // 0150 + console.log("test"); // 0200 + } // 0250 +} // 0300 +test().bar(); // 0350`, +[{"start":0,"end":399,"count":1}, + {"start":0,"end":301,"count":1}, + {"start":152,"end":253,"count":1}]); + +TestCoverage( +"https://crbug.com/v8/9952", +` +function test(foo = (()=>{})) { // 0000 + return {foo}; // 0050 +} // 0100 + // 0150 +test(()=>{}).foo(); // 0200`, +[{"start":0,"end":249,"count":1}, + {"start":0,"end":101,"count":1}, + {"start":21,"end":27,"count":0}, + {"start":205,"end":211,"count":1}] +); + %DebugToggleBlockCoverage(false);