Subj : a couple of problems w/ SM 1.6 To : netscape.public.mozilla.jseng From : celso Date : Mon Sep 12 2005 06:26 pm We've switched to using the MOZILLA_1_8_BRANCH SM/JS code in our application and are very satisfied. We've had only a couple of problems so far: - We're no more able to do, for example: app.alert.apply(app, ["alert"]) where 'app.alert' is a native function call. Both 'apply' and 'call' are throwing the exception: TypeError: app.alert.apply is not a function Both JS_HAS_APPLY_FUNCTION and JS_HAS_CALL_FUNCTION are enabled on our compilation. We're able to do the following though: function f(a) { this.alert(a) } f.apply(app, ["msg"]) - We get a recursion crash in our errorReporter (stack below). JS_EvaluateUCScriptForPrincipals calls js_ReportUncaughtException, which tries to get the exception message via js_ValueToString(cx, exn); This ends up failing and calling JS_ReportErrorNumber, which calls our error reporter (iJSErrorReporter), which has a call to js_ValueToString(cx, exn) and so on. Thanks for your attention, Celso Aguiar > EScript.api!iJSErrorReporter(JSContext * cx=0x02210a88, const char * message=0x02c696d8, JSErrorReport * report=0x0012d55c) Line 443 C++ EScript.api!js_ReportErrorAgain(JSContext * cx=0x02210a88, const char * message=0x04055608, JSErrorReport * reportp=0x0012d55c) Line 1031 + 0x17 C EScript.api!ReportError(JSContext * cx=0x02210a88, const char * message=0x04055608, JSErrorReport * reportp=0x0012d55c) Line 692 + 0x11 C EScript.api!js_ReportErrorNumberVA(JSContext * cx=0x02210a88, unsigned int flags=0, const JSErrorFormatString * (void *, const char *, const unsigned int)* callback=0x01b67380, void * userRef=0x00000000, const unsigned int errorNumber=38, int charArgs=1, char * ap=0x0012d5cc) Line 987 + 0x11 C EScript.api!JS_ReportErrorNumber(JSContext * cx=0x02210a88, const JSErrorFormatString * (void *, const char *, const unsigned int)* errorCallback=0x01b67380, void * userRef=0x00000000, const unsigned int errorNumber=38, ...) Line 4290 + 0x1d C EScript.api!js_DefaultValue(JSContext * cx=0x02210a88, JSObject * obj=0x044f0748, JSType hint=JSTYPE_STRING, long * vp=0x0012d640) Line 3285 + 0x3f C EScript.api!js_ValueToString(JSContext * cx=0x02210a88, long v=72288072) Line 2739 + 0x1b C EScript.api!JS_ValueToString(JSContext * cx=0x02210a88, long v=72288072) Line 551 + 0xd C EScript.api!iJSErrorReporter(JSContext * cx=0x02210a88, const char * message=0x02c696d8, JSErrorReport * report=0x0012db50) Line 443 + 0xd C++ EScript.api!js_ReportErrorAgain(JSContext * cx=0x02210a88, const char * message=0x04498e88, JSErrorReport * reportp=0x0012db50) Line 1031 + 0x17 C EScript.api!ReportError(JSContext * cx=0x02210a88, const char * message=0x04498e88, JSErrorReport * reportp=0x0012db50) Line 692 + 0x11 C EScript.api!js_ReportErrorNumberVA(JSContext * cx=0x02210a88, unsigned int flags=0, const JSErrorFormatString * (void *, const char *, const unsigned int)* callback=0x01b67380, void * userRef=0x00000000, const unsigned int errorNumber=38, int charArgs=1, char * ap=0x0012dbc0) Line 987 + 0x11 C EScript.api!JS_ReportErrorNumber(JSContext * cx=0x02210a88, const JSErrorFormatString * (void *, const char *, const unsigned int)* errorCallback=0x01b67380, void * userRef=0x00000000, const unsigned int errorNumber=38, ...) Line 4290 + 0x1d C EScript.api!js_DefaultValue(JSContext * cx=0x02210a88, JSObject * obj=0x044f0748, JSType hint=JSTYPE_STRING, long * vp=0x0012dc34) Line 3285 + 0x3f C EScript.api!js_ValueToString(JSContext * cx=0x02210a88, long v=72288072) Line 2739 + 0x1b C EScript.api!js_ReportUncaughtException(JSContext * cx=0x02210a88) Line 1087 + 0xd C EScript.api!JS_EvaluateUCScriptForPrincipals(JSContext * cx=0x02210a88, JSObject * obj=0x040837c8, JSPrincipals * principals=0x00000000, const unsigned short * chars=0x0475b2a0, unsigned int length=98, const char * filename=0x042f7240, unsigned int lineno=1, long * rval=0x0012debc) Line 3956 + 0x9 C EScript.api!JS_EvaluateUCScript(JSContext * cx=0x02210a88, JSObject * obj=0x040837c8, const unsigned short * chars=0x0475b2a0, unsigned int length=98, const char * filename=0x042f7240, unsigned int lineno=1, long * rval=0x0012debc) Line 3931 + 0x23 C EScript.api!ESExecScript(_s_ESExecRec * ese=0x044a6078, _s_ESScriptRec * ess=0x042f71f0, _s_ESValRec * esvResult=0x022b1da0, unsigned short bAllowUserCancel=1) Line 4820 + 0x4a C++ .