Subj : Re: js_GetSlotThreadSafe problems To : netscape.public.mozilla.jseng From : Mike Moening Date : Thu Mar 17 2005 12:25 pm The change outlined below, substituting JS_GET_CLASS for OBJ_GET_CLASS, in the macro fixes the problem! How does one go about "patching" Spidermonkey? I don't really want to have my own modified version of the source... Thanks much! "Mike Moening" wrote in message news:d1chmv$djq1@ripley.netscape.com... > Could you fix the JSVAL_IS_FUNCTION macro so it doesn't suck in non-public > stuff? > Patch the following: > > #define JSVAL_IS_FUNCTION(cx, v) > \ > (JSVAL_IS_OBJECT(v) && JSVAL_TO_OBJECT(v) && > \ > OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(v)) == &js_FunctionClass) > > To This: > > #define JSVAL_IS_FUNCTION(cx, v) > \ > (JSVAL_IS_OBJECT(v) && JSVAL_TO_OBJECT(v) && > \ > JS_GET_CLASS(cx, JSVAL_TO_OBJECT(v)) == &js_FunctionClass) > > "Mike Moening" wrote in message > news:d1chi2$7qo1@ripley.netscape.com... > > Looks like the macro JSVAL_IS_FUNCTION also brings in OBJ_GET_CLASS. > > Is there a public equivalent? > > > > Again thank you much for your time! > > > > "Mike Moening" wrote in message > > news:d1chdl$dmv2@ripley.netscape.com... > > > I changed it to read like this: > > > JS_snprintf(buf, sizeof buf, "[object %s]", > > > JS_GET_CLASS(pJSContext, JSVAL_TO_OBJECT(v))->name); > > > > > > Still the same linker error. Something else is suckin it in yet... > > > > > > "Brendan Eich" wrote in message > > > news:4239C7D0.3010702@meer.net... > > > > Mike Moening wrote: > > > > > > > > > JS_snprintf(buf, sizeof buf, "[object %s]", > > > > > OBJ_GET_CLASS(pJSContext, JSVAL_TO_OBJECT(v))->name); > > > > > > > > OBJ_GET_CLASS calls OBJ_GET_SLOT. > > > > > > > > Please don't include private headers if you can help it. Above, you > > > > could use JS_GET_CLASS instead, which is public API. > > > > > > > > /be > > > > > > > > > > > > .