зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1136925 part 1. Stop passing a parent to JS_CloneObject. r=waldo
This commit is contained in:
Родитель
e84e448ba9
Коммит
78b6722596
|
@ -1813,7 +1813,7 @@ ReparentWrapper(JSContext* aCx, JS::Handle<JSObject*> aObjArg)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
JS::Rooted<JSObject*> newobj(aCx, JS_CloneObject(aCx, aObj, proto, newParent));
|
||||
JS::Rooted<JSObject*> newobj(aCx, JS_CloneObject(aCx, aObj, proto));
|
||||
if (!newobj) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
|
|
@ -622,10 +622,10 @@ JS_SetAccumulateTelemetryCallback(JSRuntime *rt, JSAccumulateTelemetryDataCallba
|
|||
}
|
||||
|
||||
JS_FRIEND_API(JSObject *)
|
||||
JS_CloneObject(JSContext *cx, HandleObject obj, HandleObject protoArg, HandleObject parent)
|
||||
JS_CloneObject(JSContext *cx, HandleObject obj, HandleObject protoArg)
|
||||
{
|
||||
Rooted<TaggedProto> proto(cx, TaggedProto(protoArg.get()));
|
||||
return CloneObject(cx, obj, proto, parent);
|
||||
return CloneObject(cx, obj, proto);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -148,8 +148,7 @@ extern JS_FRIEND_API(JSObject *)
|
|||
JS_ObjectToOuterObject(JSContext *cx, JS::HandleObject obj);
|
||||
|
||||
extern JS_FRIEND_API(JSObject *)
|
||||
JS_CloneObject(JSContext *cx, JS::HandleObject obj, JS::HandleObject proto,
|
||||
JS::HandleObject parent);
|
||||
JS_CloneObject(JSContext *cx, JS::HandleObject obj, JS::HandleObject proto);
|
||||
|
||||
/*
|
||||
* Copy the own properties of src to dst in a fast way. src and dst must both
|
||||
|
|
|
@ -1777,7 +1777,7 @@ CopyProxyObject(JSContext *cx, Handle<ProxyObject *> from, Handle<ProxyObject *>
|
|||
}
|
||||
|
||||
JSObject *
|
||||
js::CloneObject(JSContext *cx, HandleObject obj, Handle<js::TaggedProto> proto, HandleObject parent)
|
||||
js::CloneObject(JSContext *cx, HandleObject obj, Handle<js::TaggedProto> proto)
|
||||
{
|
||||
if (!obj->isNative() && !obj->is<ProxyObject>()) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr,
|
||||
|
@ -1787,7 +1787,7 @@ js::CloneObject(JSContext *cx, HandleObject obj, Handle<js::TaggedProto> proto,
|
|||
|
||||
RootedObject clone(cx);
|
||||
if (obj->isNative()) {
|
||||
clone = NewObjectWithGivenTaggedProto(cx, obj->getClass(), proto, parent);
|
||||
clone = NewObjectWithGivenTaggedProto(cx, obj->getClass(), proto, NullPtr());
|
||||
if (!clone)
|
||||
return nullptr;
|
||||
|
||||
|
@ -1803,7 +1803,7 @@ js::CloneObject(JSContext *cx, HandleObject obj, Handle<js::TaggedProto> proto,
|
|||
ProxyOptions options;
|
||||
options.setClass(obj->getClass());
|
||||
|
||||
clone = ProxyObject::New(cx, GetProxyHandler(obj), JS::NullHandleValue, proto, parent, options);
|
||||
clone = ProxyObject::New(cx, GetProxyHandler(obj), JS::NullHandleValue, proto, nullptr, options);
|
||||
if (!clone)
|
||||
return nullptr;
|
||||
|
||||
|
|
|
@ -1137,7 +1137,7 @@ extern JSObject *
|
|||
CreateThis(JSContext *cx, const js::Class *clasp, js::HandleObject callee);
|
||||
|
||||
extern JSObject *
|
||||
CloneObject(JSContext *cx, HandleObject obj, Handle<js::TaggedProto> proto, HandleObject parent);
|
||||
CloneObject(JSContext *cx, HandleObject obj, Handle<js::TaggedProto> proto);
|
||||
|
||||
extern NativeObject *
|
||||
DeepCloneObjectLiteral(JSContext *cx, HandleNativeObject obj, NewObjectKind newKind = GenericObject);
|
||||
|
|
Загрузка…
Ссылка в новой задаче