Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c93f357

Browse filesBrowse files
committed
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: v8/v8@fa4cb17 PR-URL: #38273 Backport-PR-URL: #38991 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Mary Marchini <oss@mmarchini.me>
1 parent 3c6c28b commit c93f357
Copy full SHA for c93f357

File tree

Expand file treeCollapse file tree

3 files changed

+14
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+14
-4
lines changed
Open diff view settings
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.12',
39+
'v8_embedder_string': '-node.13',
4040

4141
##### V8 defaults for Node.js #####
4242

Collapse file

‎deps/v8/src/builtins/promise-all.tq‎

Copy file name to clipboardExpand all lines: deps/v8/src/builtins/promise-all.tq
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ Reject(Object) {
231231
// the PromiseReaction (aka we can pass undefined to
232232
// PerformPromiseThen), since this is only necessary for DevTools and
233233
// PromiseHooks.
234-
if (promiseResolveFunction != Undefined ||
235-
IsIsolatePromiseHookEnabledOrDebugIsActiveOrHasAsyncEventDelegate() ||
234+
if (promiseResolveFunction != Undefined || NeedsAnyPromiseHooks() ||
236235
IsPromiseSpeciesProtectorCellInvalid() || Is<Smi>(nextValue) ||
237236
!IsPromiseThenLookupChainIntact(
238237
nativeContext, UnsafeCast<HeapObject>(nextValue).map)) {
Collapse file

‎deps/v8/test/mjsunit/promise-hooks.js‎

Copy file name to clipboardExpand all lines: deps/v8/test/mjsunit/promise-hooks.js
+12-1Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ exceptions();
246246
(function regress1126309() {
247247
function __f_16(test) {
248248
test();
249-
d8.promise.setHooks( undefined, () => {});
249+
d8.promise.setHooks(undefined, () => {});
250250
%PerformMicrotaskCheckpoint();
251251
d8.promise.setHooks();
252252
}
@@ -262,3 +262,14 @@ exceptions();
262262
%PerformMicrotaskCheckpoint();
263263
d8.promise.setHooks();
264264
})();
265+
266+
267+
(function promiseAll() {
268+
let initCount = 0;
269+
d8.promise.setHooks(() => { initCount++});
270+
Promise.all([Promise.resolve(1)]);
271+
%PerformMicrotaskCheckpoint();
272+
assertEquals(initCount, 3);
273+
274+
d8.promise.setHooks();
275+
})();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.