diff --git a/js/src/xpconnect/src/xpcprivate.h b/js/src/xpconnect/src/xpcprivate.h index 1f877dd5d812..0d082a30716d 100644 --- a/js/src/xpconnect/src/xpcprivate.h +++ b/js/src/xpconnect/src/xpcprivate.h @@ -1391,14 +1391,7 @@ public: *pval = mVal; return JS_TRUE;} JSBool NewFunctionObject(XPCCallContext& ccx, XPCNativeInterface* iface, - JSObject *parent, jsval* pval) - {NS_ASSERTION(!IsConstant(), - "Only call this if you're sure this is not a constant!"); - if(!IsResolved() && !Resolve(ccx, iface)) return JS_FALSE; - JSObject* funobj = - xpc_CloneJSFunction(ccx, JSVAL_TO_OBJECT(mVal), parent); - if(!funobj) return JS_FALSE; - *pval = OBJECT_TO_JSVAL(funobj); return JS_TRUE;} + JSObject *parent, jsval* pval); JSBool IsMethod() const {return 0 != (mFlags & METHOD);} diff --git a/js/src/xpconnect/src/xpcwrappednativeinfo.cpp b/js/src/xpconnect/src/xpcwrappednativeinfo.cpp index 57da14424019..cde7d7c4dbfb 100644 --- a/js/src/xpconnect/src/xpcwrappednativeinfo.cpp +++ b/js/src/xpconnect/src/xpcwrappednativeinfo.cpp @@ -109,6 +109,27 @@ XPCNativeMember::GetCallInfo(XPCCallContext& ccx, return JS_TRUE; } +JSBool +XPCNativeMember::NewFunctionObject(XPCCallContext& ccx, + XPCNativeInterface* iface, JSObject *parent, + jsval* pval) +{ + NS_ASSERTION(!IsConstant(), + "Only call this if you're sure this is not a constant!"); + if(!IsResolved() && !Resolve(ccx, iface)) + return JS_FALSE; + + AUTO_MARK_JSVAL(ccx, &mVal); + JSObject* funobj = + xpc_CloneJSFunction(ccx, JSVAL_TO_OBJECT(mVal), parent); + if(!funobj) + return JS_FALSE; + + *pval = OBJECT_TO_JSVAL(funobj); + + return JS_TRUE; +} + JSBool XPCNativeMember::Resolve(XPCCallContext& ccx, XPCNativeInterface* iface) {