So this is actually being called from Contextify in node:

//(script land...)
x = new Contextify();
y = new Script("whatever);
y.runInContext(x) // this internally calls script->Run(), if the isolate is 
killed, then so is the managing code. I *just* want y to be killed.

On Monday, November 17, 2014 11:38:19 AM UTC-8, Ben Noordhuis wrote:
>
> On Mon, Nov 17, 2014 at 6:47 PM, Francisco Tolmasky <tolm...@gmail.com 
> <javascript:>> wrote: 
> > I'm not exactly looking for TerminateExecution, rather, being able to 
> > prematurely kill a script initiated from ::Run() (Think ala 
> window.close()). 
> > Essentially, a Script is compiled and run, which may wish to terminate 
> > itself (but not the entire isolate). Something like "if (condition) 
> > __exit__() else { do other stuff }". 
> > Its not enough to throw an exception because the script itself might 
> catch 
> > it... "try { something_that_calls_exit() } catch(e) { //oops caught the 
> exit 
> > }" 
> > I'm happy to write the bindings to expose something that has a handle to 
> the 
> > original Script object and kills it if that's possible. 
> > 
> > (Just for actual context, this is where the issue is coming up 
> (simulating a 
> > browser environment): https://github.com/tmpvar/jsdom/issues/955 ) 
>
> It's not entirely clear to me why TerminateExecution() wouldn't work 
> for that.  This should do it, right? 
>
>   TryCatch try_catch; 
>   script->Run(); 
>   if (try_catch.CanContinue() == false && try_catch.HasTerminated() == 
> true) { 
>     isolate->CancelTerminateExecution(); 
>   } 
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to