Subj : Re: [spidermonkey] How to return null in constructor To : Matthew Mondor From : Brendan Eich Date : Fri Aug 05 2005 10:06 am Matthew Mondor wrote: > On Fri, 5 Aug 2005 12:53:47 +0900 > "Keiji SAKAKI" wrote: > > >>I would like to knonw How to return null in constructor. > > > Possibly try *rval = OBJECT_TO_JSVAL(NULL); That's the same as *rval = JSVAL_NULL. > Alternatively, you can make the constructor throw an exception > on error. That's more like it. A constructor is not meant to return a primitive type value such as null. If it's going to fail, it should throw. /be .