diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 7b1a656a660..e3e535697f2 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -1898,8 +1898,7 @@ ResolvePrototype(nsIXPConnect *aXPConnect, nsGlobalWindow *aWin, JSContext *cx, } dot_prototype = ::JS_NewObjectWithUniqueType(cx, &sDOMConstructorProtoClass, - proto, - winobj); + proto); NS_ENSURE_TRUE(dot_prototype, NS_ERROR_OUT_OF_MEMORY); } } diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index bb25932fd73..a77cd1d251e 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -614,7 +614,7 @@ CreateInterfacePrototypeObject(JSContext* cx, JS::Handle global, const NativeProperties* chromeOnlyProperties) { JS::Rooted ourProto(cx, - JS_NewObjectWithUniqueType(cx, Jsvalify(protoClass), parentProto, global)); + JS_NewObjectWithUniqueType(cx, Jsvalify(protoClass), parentProto)); if (!ourProto || !DefineProperties(cx, ourProto, properties, chromeOnlyProperties)) { return nullptr; diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index ce5b3dafa6c..8c1b536c2c2 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -127,8 +127,7 @@ JS_SplicePrototype(JSContext *cx, HandleObject obj, HandleObject proto) } JS_FRIEND_API(JSObject *) -JS_NewObjectWithUniqueType(JSContext *cx, const JSClass *clasp, HandleObject proto, - HandleObject parent) +JS_NewObjectWithUniqueType(JSContext *cx, const JSClass *clasp, HandleObject proto) { /* * Create our object with a null proto and then splice in the correct proto @@ -137,7 +136,7 @@ JS_NewObjectWithUniqueType(JSContext *cx, const JSClass *clasp, HandleObject pro * we're not going to be using that ObjectGroup anyway. */ RootedObject obj(cx, NewObjectWithGivenProto(cx, (const js::Class *)clasp, NullPtr(), - parent, SingletonObject)); + NullPtr(), SingletonObject)); if (!obj) return nullptr; if (!JS_SplicePrototype(cx, obj, proto)) diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index e6b064677dd..4687cf4a578 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -57,8 +57,7 @@ extern JS_FRIEND_API(bool) JS_SplicePrototype(JSContext *cx, JS::HandleObject obj, JS::HandleObject proto); extern JS_FRIEND_API(JSObject *) -JS_NewObjectWithUniqueType(JSContext *cx, const JSClass *clasp, JS::HandleObject proto, - JS::HandleObject parent); +JS_NewObjectWithUniqueType(JSContext *cx, const JSClass *clasp, JS::HandleObject proto); // Allocate an object in exactly the same way as JS_NewObjectWithGivenProto, but // without invoking the metadata callback on it. This allows creation of diff --git a/js/xpconnect/src/XPCWrappedNativeProto.cpp b/js/xpconnect/src/XPCWrappedNativeProto.cpp index 5831ee80f42..c2ffcb25d89 100644 --- a/js/xpconnect/src/XPCWrappedNativeProto.cpp +++ b/js/xpconnect/src/XPCWrappedNativeProto.cpp @@ -87,10 +87,10 @@ XPCWrappedNativeProto::Init(const XPCNativeScriptableCreateInfo* scriptableCreat jsclazz = &XPC_WN_NoMods_NoCall_Proto_JSClass; } - JS::RootedObject parent(cx, mScope->GetGlobalJSObject()); - JS::RootedObject proto(cx, JS_GetObjectPrototype(cx, parent)); + JS::RootedObject global(cx, mScope->GetGlobalJSObject()); + JS::RootedObject proto(cx, JS_GetObjectPrototype(cx, global)); mJSProtoObject = JS_NewObjectWithUniqueType(cx, js::Jsvalify(jsclazz), - proto, parent); + proto); bool success = !!mJSProtoObject; if (success) {