зеркало из https://github.com/mozilla/gecko-dev.git
Bug 702106 - Remove xpc_CloneJSFunction; r=bholley
This commit is contained in:
Родитель
91d25c9eda
Коммит
935180aaad
|
@ -45,45 +45,6 @@
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
/*
|
||||
* Helper that clones JS Function objects along with both of its
|
||||
* reserved slots.
|
||||
*/
|
||||
|
||||
JSObject *
|
||||
xpc_CloneJSFunction(XPCCallContext &ccx, JSObject *funobj, JSObject *parent)
|
||||
{
|
||||
JSObject *clone = JS_CloneFunctionObject(ccx, funobj, parent);
|
||||
if (!clone)
|
||||
return nsnull;
|
||||
|
||||
AUTO_MARK_JSVAL(ccx, OBJECT_TO_JSVAL(clone));
|
||||
|
||||
XPCWrappedNativeScope *scope =
|
||||
XPCWrappedNativeScope::FindInJSObjectScope(ccx, parent);
|
||||
|
||||
if (!scope) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
// Make sure to break the prototype chain to the function object
|
||||
// we cloned to prevent its scope from leaking into the clones
|
||||
// scope.
|
||||
JS_SetPrototype(ccx, clone, scope->GetPrototypeJSFunction());
|
||||
|
||||
// Copy the reserved slots to the clone.
|
||||
jsval ifaceVal, memberVal;
|
||||
if (!JS_GetReservedSlot(ccx, funobj, 0, &ifaceVal) ||
|
||||
!JS_GetReservedSlot(ccx, funobj, 1, &memberVal))
|
||||
return nsnull;
|
||||
|
||||
if (!JS_SetReservedSlot(ccx, clone, 0, ifaceVal) ||
|
||||
!JS_SetReservedSlot(ccx, clone, 1, memberVal))
|
||||
return nsnull;
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
// XPCNativeMember
|
||||
|
||||
// static
|
||||
|
|
|
@ -1686,9 +1686,6 @@ private:
|
|||
JSBool mNewDOMBindingsEnabled;
|
||||
};
|
||||
|
||||
JSObject* xpc_CloneJSFunction(XPCCallContext &ccx, JSObject *funobj,
|
||||
JSObject *parent);
|
||||
|
||||
/***************************************************************************/
|
||||
// XPCNativeMember represents a single idl declared method, attribute or
|
||||
// constant.
|
||||
|
|
Загрузка…
Ссылка в новой задаче