Subj : Re: "abort" SpiderMonkey To : Braden McDaniel From : Brendan Eich Date : Mon May 12 2003 11:54 am Braden McDaniel wrote: >Is it possible to effectively halt the JavaScript engine and shut it >down midway through executing a script, without the current script >function having the chance to return? > Return false from a native and the script will silently terminate -- report an error or throw an exception first if you want non-silence. If you don't have such a native (abort(), e.g.), but want a top-level script to be able to stop its own execution abruptly, it'll have to throw null, and your native code that evaluates the script can suppress that particular exception. /be .