Subject: | Compilation problem |
There seems to be a problem with compilation of JavaScript.xs.
I'm compiling it on a Debian system with libmozjs version 1.9 rc2.
JSFunction->object is a JSObject and it can't be cast to jsval.
I have to apply a patch to make the JavaScript.xs compile:
*************** jsc_call(cx, function, args)
*** 294,300 ****
tmp = SvIV((SV*)SvRV(PJS_call_perl_method("content",
function, NULL)));
func = INT2PTR(JSFunction *, tmp);
! if (PJS_call_javascript_function(cx, (jsval)
(func->object), args, &rval) == JS_FALSE) {
/* Exception was thrown */
XSRETURN_UNDEF;
}
--- 294,300 ----
tmp = SvIV((SV*)SvRV(PJS_call_perl_method("content",
function, NULL)));
func = INT2PTR(JSFunction *, tmp);
! if (PJS_call_javascript_function(cx, OBJECT_TO_JSVAL
(FUN_OBJECT(func)), args, &rval) == JS_FALSE) {
/* Exception was thrown */
XSRETURN_UNDEF;
}