Subj : Re: [spidermonkey] How to return null in constructor To : netscape.public.mozilla.jseng From : Matthew Mondor Date : Fri Aug 05 2005 01:31 am 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); Alternatively, you can make the constructor throw an exception on error. Also, it might be useful to check out JS_IsConstructing() which allows your constructor to detect when it's being called as a constructor with "new" or as a plain function (i.e. var custom = Custom()) and act accordingly (you can actually get assertions related crashes otherwise if SpiderMonkey was compiled with debugging support)... Matt -- Note: Please only reply on the list, other mail is blocked by default. Private messages from your address can be allowed by first asking. .