deps: cherry-pick 907d7bc from upstream V8
Original commit message:
[promise] Implement Swallowed Rejection Hook.
This extends the current Promise Rejection Hook with two new events
kPromiseRejectAfterResolved
kPromiseResolveAfterResolved
which are used to detect (and signal) misuse of the Promise constructor.
Specifically the common bug like
new Promise((res, rej) => {
res(1);
throw new Error("something")
});
where the error is silently swallowed by the Promise constructor without
the user ever noticing can be caught via this hook.
Doc: https://goo.gl/2stLUY
Bug: v8:7919
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I890a7e766cdd1be88db94844fb744f72823dba33
Reviewed-on: https://chromium-review.googlesource.com/1126099
Reviewed-by:
Maya Lekova <mslekova@chromium.org>
Reviewed-by:
Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by:
Yang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54309}
Refs: https://github.com/v8/v8/commit/907d7bcd18c13a04a14eea6699e54167494bf9f9
PR-URL: https://github.com/nodejs/node/pull/21838
Refs: https://github.com/nodejs/promises-debugging/issues/8
Reviewed-By:
Gus Caplan <me@gus.host>
Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By:
James M Snell <jasnell@gmail.com>
Reviewed-By:
Yang Guo <yangguo@chromium.org>
Reviewed-By:
Benedikt Meurer <benedikt.meurer@gmail.com>
parent
72807807
Please register or sign in to comment