On 2012/10/01 11:54:28, Yang wrote:
This is to make the message listener be able to access the error object that
is
causing the thrown exception.

Even though this does not change the API syntax, it changes its semantics, as described in v8.h. We would be using the data argument for the preset value if
available, or the pending exception if former is not.

Alternatives that may be cleaner are:
- Changes to the API syntax, adding one more argument to MessageCallback to
pass
the exception.
- Piggyback the Error object on the Message object by adding a new field to
the
latter.

I haven't found any use for the optional second argument of AddMessageListener (either in Chromium or Node.js), so I assume that it's an ancient relics of a
time long forgotten. I'm removing the second argument entirely. This has the
advantage that:
- We can be sure of the meaning of the second argument in the MessageCallback.
If some embedder is indeed still using it to get the second argument for
AddMessageListener, he will notice simply because AddMessageListener stops
working that way.
- We don't have to change the definition for MessageCallback, as the signature remains the same. This saves us a lot of hassle sync'ing the change with WebKit.

http://codereview.chromium.org/11014017/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to