Addressed/replied to comments.

https://codereview.chromium.org/600723005/diff/40001/src/debug.cc
File src/debug.cc (right):

https://codereview.chromium.org/600723005/diff/40001/src/debug.cc#newcode2516
src/debug.cc:2516: OnException(value, false, promise);
On 2014/09/30 14:08:24, aandrey wrote:
I think we should move to here:
   JSObject::SetProperty(jspromise, key, key, STRICT);

Also maybe move
   uncaught = has_reject_handler->IsFalse();
as well?

That would not work. When a promise is rejected via throw, we trigger
the debug event at the throw site via OnThrow. Later when the try-catch
in PromiseHandle or the Promise constructor catches that throw, the
reject closure is called, which would trigger a second debug event. To
prevent such a duplicate event, we simply mark it the first time we see
it.

I moved it to OnThrow instead.

Regarding uncaught: on both code paths (OnThrow and OnPromiseReject) we
could see either caught or uncaught promise rejects. So to avoid code
duplication I would just leave the call to
PromiseHasUserDefinedRejectHandler in OnException.

https://codereview.chromium.org/600723005/diff/40001/src/promise.js
File src/promise.js (right):

https://codereview.chromium.org/600723005/diff/40001/src/promise.js#newcode209
src/promise.js:209: %PromiseRejectEvent(promise, r, false);
On 2014/09/30 14:08:24, aandrey wrote:
a comment why using "false" but not DEBUG_IS_ACTIVE?

Done.

https://codereview.chromium.org/600723005/

--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to