Subj : Re: Corrected Re: Ignore the other one To : Izman From : Brendan Eich Date : Tue Sep 16 2003 10:23 am Izman wrote: >Thank you for your help Brendan. I am using the win32 debug build of >js-1.5-rc5a.tar.gz file downloaded from ftp://ftp.mozilla.org/pub/js/. I tried using the win32 release build but it crashes my app every time I try and use a script, even though the app and js32.dll compile with no errors or warnings. I use VS6 and compile through the IDE. > You need to link with /OPT:NOICF -- see bug http://bugzilla.mozilla.org/show_bug.cgi?id=151066 and the release notes. This is necessary to work around a bug in MSVC that bites RC5 and RC5a. >Added error checking to the constructor and set rval to the obj: >JSBool JSMyObject::JSConstructor(JSContext *cx, JSObject *obj, > uintN argc, jsval *argv, jsval *rval) >{ > JSMyObject *p = new JSMyObject(); > > if (!p) > return JS_FALSE; > > Aside: You'll want to JS_ReportOutOfMemory(cx) before returning false if (!p). I'm not sure why the second property is not being defined correctly. Could you send me the full code (including the JS and the C++), or the code for a reduced but complete testcase, so I can debug it? Alternatively, can you run a debugger on your embedding application and try to see what is going wrong? /be .