On Oct 22, 4:29 pm, Ben Noordhuis <[email protected]> wrote: > On Fri, Oct 22, 2010 at 15:12, Andrea Odetti <[email protected]> wrote: > > Meanwhile, do I need to call TryCatch::CanContinue() after each and > > every call into v8? Just in case something was thrown? > > For every call into V8 that results in JS code being run, yes. > > That's probably not very often, though. To take node.js as an example: > only the main loop deals with TryCatch, everything else is callbacked > from JS land.
My experience embedding v8 into a proprietary project was similar, only needed TryCatch in four places. Initialization, the main loop, event callback processor, and a compile method because eval didn't attach file name and line numbers :( I have a hard time imagining you would ever need more than a few. Also I never continue, perhaps I'm not doing it right :) I just check HasCaught, return an error and log the stack trace if true, otherwise do nothing. Glen -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
