Subj : Re: SpiderMonkey: JavaScript exceptions and native code To : Braden McDaniel From : Brendan Eich Date : Sun Aug 10 2003 11:11 pm Braden McDaniel wrote: >Can failure in any of the JS_* API functions result in a JavaScript >exception being thrown? What, in general, is the proper way to deal with >that in native code? Just return JS_TRUE ASAP? > No, return JS_FALSE. A false return (or null, if the return value is of pointer type and null is available without overloading that return value) means error or exception. You can check whether an exception is pending on a given context with JS_IsExceptionPending. The JS_Compile*, JS_Evaluate*, JS_ExecuteScript, and JS_CallFunction* APIs will report uncaught exceptions if returning false or null to a caller using a context with no stack frames active. /be .