mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
deps: V8: cherry-pick fa4cb172cde2
Original commit message:
[runtime] Fix Promise.all context promise hooks
We have to take the slow path in Promise.all if context promise hooks
are set. The fast-path doesn't create intermediate promises by default.
Bug: chromium:1204132, v8:11025
Change-Id: Ide92de00a4f6df05e0ddbc8814f6673bd667f426
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2866771
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74326}
Refs: fa4cb172cd
PR-URL: https://github.com/nodejs/node/pull/38577
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
4a2d6ad609
commit
f2d34a8cd6
|
|
@ -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.80',
|
||||
'v8_embedder_string': '-node.81',
|
||||
|
||||
##### V8 defaults for Node.js #####
|
||||
|
||||
|
|
|
|||
3
deps/v8/src/builtins/promise-all.tq
vendored
3
deps/v8/src/builtins/promise-all.tq
vendored
|
|
@ -233,8 +233,7 @@ Reject(Object) {
|
|||
// the PromiseReaction (aka we can pass undefined to
|
||||
// PerformPromiseThen), since this is only necessary for DevTools and
|
||||
// PromiseHooks.
|
||||
if (promiseResolveFunction != Undefined ||
|
||||
IsIsolatePromiseHookEnabledOrDebugIsActiveOrHasAsyncEventDelegate() ||
|
||||
if (promiseResolveFunction != Undefined || NeedsAnyPromiseHooks() ||
|
||||
IsPromiseSpeciesProtectorCellInvalid() || Is<Smi>(nextValue) ||
|
||||
!IsPromiseThenLookupChainIntact(
|
||||
nativeContext, UnsafeCast<HeapObject>(nextValue).map)) {
|
||||
|
|
|
|||
11
deps/v8/test/mjsunit/promise-hooks.js
vendored
11
deps/v8/test/mjsunit/promise-hooks.js
vendored
|
|
@ -262,3 +262,14 @@ exceptions();
|
|||
%PerformMicrotaskCheckpoint();
|
||||
d8.promise.setHooks();
|
||||
})();
|
||||
|
||||
|
||||
(function promiseAll() {
|
||||
let initCount = 0;
|
||||
d8.promise.setHooks(() => { initCount++});
|
||||
Promise.all([Promise.resolve(1)]);
|
||||
%PerformMicrotaskCheckpoint();
|
||||
assertEquals(initCount, 3);
|
||||
|
||||
d8.promise.setHooks();
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user