Subj : [spidermonkey] How to return null in constructor To : netscape.public.mozilla.jseng From : Keiji SAKAKI Date : Fri Aug 05 2005 01:53 pm Hallo, I would like to knonw How to return null in constructor. I'm using Spidermonkey in my c++ project. I defined my custom class for JavaScript with name "Custom". I have the following script: function foo() { var custom = new Custom(); if ( custom != null ) { (codeA) } else { (codeB) } } (in my c++ code) JSBool JSCustom::JSConstructor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { *rval = JSVAL_NULL; retunr JS_TRUE; } After executing the script, "custom" is not null and codeA is executed. Now I would like to set value of "custom" null in constructor. Is this possible? Greetings Keiji SAKAKI .