What is the purpose of (meaning behind)
Top::external_caught_exception_?  Does it mean that:
1. an exception has been thrown but has not been handled yet (i.e. yet
to be caught / exception is pending)?
2. an exception has been thrown and we are now executing in the
handler code (i.e. has been caught, but we're still in an exception
handler)?

>From grepping the code, I see that it is used for assertions in
api.cc, and execution.cc.  These assertions seem to imply that the
flag refers to meaning 1 above, and every place that executes JS
code / accessors is verifying that there isn't a pending exception
before executing.  Is that right?

If the flag does mean that there is a pending exception that is to be
caught by a handler in the C++ code (presumably by a v8::TryCatch
instance?), then shouldn't there be some means to clear this flag once
we have "caught" the exception in the C++ code, presumably by checking
HasCaught() on the TryCatch object?

However, I don't see any methods in the TryCatch object that will
allow C++ code to clear this flag.  The only method that might be the
right place to clear this flag is TryCatch::Reset() but I see that the
flag isn't currently cleared there.

One way to clear this flag is by calling Top::clear_pending_exception
() followed by Top::setup_external_caught().  Is it OK to add those 2
calls in v8::TryCatch::Reset()?  Or would that break something?
Please advise.

Thanks.


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

Reply via email to