Subj : Re: SpiderMonkey: JavaScript exceptions and native code To : netscape.public.mozilla.jseng From : Brendan Eich Date : Sun Aug 10 2003 11:29 pm Brendan Eich wrote: > 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. This remark applies to almost all APIs taking cx as the first parameter. See the JS_InstanceOf followup for a conditional (depending on whether the argv parameter is null) exception to the rule. /be .