That observation is correct and it is the intended behavior. Through the API you can throw JavaScript exceptions. If no JavaScript is running they will have no effect. Exceptions scheduled through the api will be thrown when control is passed to JavaScript again.
Cheers, -- Mads On Sat, Jan 15, 2011 at 9:43 PM, ondras <[email protected]> wrote: > Hi, > > it looks like it is not possible to throw an exception from C++ when there > is no JS code currently being executed. For instance: > > /* create context first etc... */ > v8::TryCatch tc; > v8::ThrowException("..."); > if (tc.HasCaught()) { ... } > > This external exception handler does not catch, even if I execute arbitrary > (non-throwing) javascript after calling the v8::ThrowException(). > > 1) is my observation correct? > 2) is this behavior correct? > > > Thanks, > Ondrej > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
