Comment #42 on issue 3093 by [email protected]: Debugging promises
http://code.google.com/p/v8/issues/detail?id=3093
Wow. Huge thread over night.
So here's the current state:
When an exception is thrown in a promise, it would be swallowed and
forwarded to the (possibly not yet) registered reject handlers. If the
debugger is active (devtools opened), the debug event listener (registered
by devtools) receives an uncaught exception event if there is no reject
handler registered at the time of the throw. If you turned on "break on
uncaught exception", this stops execution.
A problem with this is that if the exception is thrown in the closure
passed to the Promise constructor, there can't be possibly a reject handler
registered yet, so we always get that uncaught exception even if we
register a reject handler later for the end of turn.
What also exist are PromiseMirror objects to be used by devtools. So far
they only offer insight into the state of the PromiseMirror and its value
when resolved/rejected. I don't think this is already used by devtools yet
at the moment.
The next step is to introduce a new debug event type for Promise events,
such as chaining, resolving/rejecting etc. Using those events, devtools
could figure out the dependency of Promise chains to display. We do not
want to explicitly keep those dependencies in V8 to prevent memory leaks.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.