mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
deps: V8: cherry-pick 1d7159580156
Original commit message:
[explicit-resource-management] Clear isolate internal exception
This CL clears the isolate internal exception before rejecting
the promise.
Bug: 418103036
Change-Id: If3748f7fc4b79b7b5be5009b9fff0d0267541a6f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6594252
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#100532}
Refs: 1d71595801
PR-URL: https://github.com/nodejs/node/pull/58749
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
6a3b545b4d
commit
8db664f72c
|
|
@ -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.14',
|
||||
'v8_embedder_string': '-node.15',
|
||||
|
||||
##### V8 defaults for Node.js #####
|
||||
|
||||
|
|
|
|||
|
|
@ -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, {});
|
||||
|
||||
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
26
deps/v8/test/mjsunit/harmony/regress/regress-418103036.js
vendored
Normal file
26
deps/v8/test/mjsunit/harmony/regress/regress-418103036.js
vendored
Normal file
|
|
@ -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…
Reference in New Issue
Block a user