Skip to content

deps: V8: cherry-pick 1d7159580156 #58749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,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.13',
'v8_embedder_string': '-node.14',

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

Expand Down
7 changes: 2 additions & 5 deletions deps/v8/src/builtins/builtins-async-disposable-stack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ BUILTIN(AsyncDisposeFromSyncDispose) {
kMethod))),
isolate);

v8::TryCatch try_catch(reinterpret_cast<v8::Isolate*>(isolate));
try_catch.SetVerbose(false);
try_catch.SetCaptureMessage(false);

MaybeDirectHandle<Object> result =
Execution::Call(isolate, sync_method, receiver, {});

Expand All @@ -107,7 +103,8 @@ BUILTIN(AsyncDisposeFromSyncDispose) {
return {};
}
// d. IfAbruptRejectPromise(result, promiseCapability).
DCHECK(try_catch.HasCaught());
isolate->clear_internal_exception();
isolate->clear_pending_message();
JSPromise::Reject(promise, direct_handle(exception, isolate));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ Correctly predicted as caught

Running test: testCase
> Throwing from throwInAsyncDisposeFormSync, handling with dontHandleAsync
Paused on caught exception
Paused on uncaught promiseRejection
[Symbol.dispose] (catch-prediction.js:188:6)
throwInAsyncDisposeFormSync (catch-prediction.js:185:18)
dontHandleAsync (catch-prediction.js:196:8)
Expand Down Expand Up @@ -1171,7 +1171,7 @@ Correctly predicted as uncaught

Running test: testCase
> Throwing from throwInAsyncDisposeFormSync, handling with awaitAndCreateInTry
Paused on caught exception
Paused on caught promiseRejection
[Symbol.dispose] (catch-prediction.js:188:6)
throwInAsyncDisposeFormSync (catch-prediction.js:185:18)
awaitAndCreateInTry (catch-prediction.js:202:10)
Expand Down
26 changes: 26 additions & 0 deletions deps/v8/test/mjsunit/harmony/regress/regress-418103036.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Flags: --ignore-unhandled-promises

const obj = {
get f() {
async function f() {
function g() {
throw 1;
}
g[Symbol.dispose] = g;
await using y = g;
}
return f();
},
};

async function test(obj) {
const ser = d8.serializer.serialize(obj);
const des = d8.serializer.deserialize(ser);
await des;
}

assertThrowsAsync(test(obj), Error);
Loading