Bug 1127475 - Remove unnecessary parent arguments. r=bz

This commit is contained in:
Tom Schuster
2015-02-13 12:20:02 +01:00
parent 97817a2338
commit 8fe10da3cb
4 changed files with 7 additions and 9 deletions

View File

@@ -1991,7 +1991,8 @@ nsWindowSH::GlobalResolve(nsGlobalWindow *aWin, JSContext *cx,
if (aWin->GetDoc()) {
aWin->GetDoc()->WarnOnceAbout(nsIDocument::eWindow_Controllers);
}
JS::Rooted<JSObject*> shim(cx, JS_NewObject(cx, &ControllersShimClass, obj));
MOZ_ASSERT(JS_IsGlobalObject(obj));
JS::Rooted<JSObject*> shim(cx, JS_NewObject(cx, &ControllersShimClass));
if (NS_WARN_IF(!shim)) {
return NS_ERROR_OUT_OF_MEMORY;
}

View File

@@ -400,9 +400,7 @@ WrapperAnswer::RecvCallOrConstruct(const ObjectId &objId,
for (size_t i = 0; i < argv.Length(); i++) {
if (argv[i].type() == JSParam::Tvoid_t) {
// This is an outparam.
JSCompartment *compartment = js::GetContextCompartment(cx);
RootedObject global(cx, JS_GetGlobalForCompartmentOrNull(cx, compartment));
RootedObject obj(cx, xpc::NewOutObject(cx, global));
RootedObject obj(cx, xpc::NewOutObject(cx));
if (!obj)
return fail(cx, rs);
if (!outobjects.append(ObjectValue(*obj)))

View File

@@ -1124,7 +1124,7 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex,
if (param.IsOut() || param.IsDipper()) {
// create an 'out' object
RootedObject out_obj(cx, NewOutObject(cx, obj));
RootedObject out_obj(cx, NewOutObject(cx));
if (!out_obj) {
retval = NS_ERROR_OUT_OF_MEMORY;
goto pre_call_clean_up;
@@ -1469,10 +1469,9 @@ xpc::IsOutObject(JSContext* cx, JSObject* obj)
}
JSObject*
xpc::NewOutObject(JSContext* cx, JSObject* scope)
xpc::NewOutObject(JSContext* cx)
{
RootedObject global(cx, JS_GetGlobalForObject(cx, scope));
return JS_NewObject(cx, nullptr, global);
return JS_NewObject(cx, &XPCOutParamClass);
}

View File

@@ -3753,7 +3753,7 @@ ObjectScope(JSObject *obj)
return CompartmentPrivate::Get(obj)->scope;
}
JSObject* NewOutObject(JSContext* cx, JSObject* scope);
JSObject* NewOutObject(JSContext* cx);
bool IsOutObject(JSContext* cx, JSObject* obj);
nsresult HasInstance(JSContext *cx, JS::HandleObject objArg, const nsID *iid, bool *bp);