Skip to content

Commit

Permalink
v8: Prepare for swallowed rejection hook.
Browse files Browse the repository at this point in the history
This is done in preparation for landing

  https://chromium-review.googlesource.com/c/v8/v8/+/1126099

on the V8 side, which extends the existing PromiseRejectEvent mechanism
with new hooks for reject/resolve after a Promise was previously
resolved already.

Refs: nodejs/promises-debugging#8
Design: https://goo.gl/2stLUY
  • Loading branch information
bmeurer committed Jul 5, 2018
1 parent 6c52f33 commit bdc0ab1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,9 @@ void PromiseRejectCallback(PromiseRejectMessage message) {
callback = env->promise_reject_handled_function();
value = Undefined(isolate);
} else {
UNREACHABLE();
// Ignore reject/resolve after resolved events for now.
// TODO(benjamingr) warn about misuse of Promise constructor.
return;
}

Local<Value> args[] = { promise, value };
Expand Down

0 comments on commit bdc0ab1

Please sign in to comment.