Bug 1528628 - Remove unused JSContext argument of JS_ObjectIsFunction. r=sfink

Differential Revision: https://phabricator.services.mozilla.com/D20114

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Shivam Singhal 2019-02-21 20:42:54 +00:00
parent a036edcd64
commit 4064daf089
8 changed files with 8 additions and 9 deletions

View File

@ -1313,7 +1313,7 @@ inline const NativePropertyHooks* GetNativePropertyHooks(
return domClass->mNativeHooks;
}
if (JS_ObjectIsFunction(cx, obj)) {
if (JS_ObjectIsFunction(obj)) {
type = eInterface;
return GetNativePropertyHooksFromConstructorFunction(obj);
}

View File

@ -2278,7 +2278,7 @@ inline bool XrayGetNativeProto(JSContext* cx, JS::Handle<JSObject*> obj,
} else {
protop.set(JS::GetRealmObjectPrototype(cx));
}
} else if (JS_ObjectIsFunction(cx, obj)) {
} else if (JS_ObjectIsFunction(obj)) {
MOZ_ASSERT(JS_IsNativeFunction(obj, Constructor));
protop.set(JS::GetRealmFunctionPrototype(cx));
} else {

View File

@ -677,8 +677,7 @@ bool nsJSObjWrapper::NP_HasMethod(NPObject *npobj, NPIdentifier id) {
JS::Rooted<JS::Value> v(cx);
bool ok = GetProperty(cx, npjsobj->mJSObj, id, &v);
return ok && !v.isPrimitive() &&
::JS_ObjectIsFunction(cx, v.toObjectOrNull());
return ok && !v.isPrimitive() && ::JS_ObjectIsFunction(v.toObjectOrNull());
}
static bool doInvoke(NPObject *npobj, NPIdentifier method,

View File

@ -23,7 +23,7 @@ BEGIN_TEST(testBoundFunction) {
CHECK(!JS_GetBoundFunctionTarget(foofun));
JSObject* target = JS_GetBoundFunctionTarget(boundfun);
CHECK(!!target);
CHECK(JS_ObjectIsFunction(cx, target));
CHECK(JS_ObjectIsFunction(target));
JS::RootedValue targetVal(cx, JS::ObjectValue(*target));
CHECK_SAME(foo, targetVal);

View File

@ -151,7 +151,7 @@ BEGIN_TEST(test_cloneScriptWithPrincipals) {
CHECK(v.isObject());
JSObject* funobj = &v.toObject();
CHECK(JS_ObjectIsFunction(cx, funobj));
CHECK(JS_ObjectIsFunction(funobj));
CHECK(fun = JS_ValueToFunction(cx, v));
CHECK(script = JS_GetFunctionScript(cx, fun));
CHECK(JS_GetScriptPrincipals(script) == principalsB);

View File

@ -3339,7 +3339,7 @@ JS_PUBLIC_API bool JS_GetFunctionLength(JSContext* cx, HandleFunction fun,
return JSFunction::getLength(cx, fun, length);
}
JS_PUBLIC_API bool JS_ObjectIsFunction(JSContext* cx, JSObject* obj) {
JS_PUBLIC_API bool JS_ObjectIsFunction(JSObject* obj) {
return obj->is<JSFunction>();
}

View File

@ -2211,7 +2211,7 @@ JS_PUBLIC_API bool JS_GetFunctionLength(JSContext* cx, JS::HandleFunction fun,
* overwritten the "Function" identifier with a different constructor and then
* created instances using that constructor that might be passed in as obj).
*/
extern JS_PUBLIC_API bool JS_ObjectIsFunction(JSContext* cx, JSObject* obj);
extern JS_PUBLIC_API bool JS_ObjectIsFunction(JSObject* obj);
extern JS_PUBLIC_API bool JS_IsNativeFunction(JSObject* funobj, JSNative call);

View File

@ -447,7 +447,7 @@ static bool SendCommand(JSContext* cx, unsigned argc, Value* vp) {
return false;
}
if (args.get(1).isObject() && !JS_ObjectIsFunction(cx, &args[1].toObject())) {
if (args.get(1).isObject() && !JS_ObjectIsFunction(&args[1].toObject())) {
JS_ReportErrorASCII(cx, "Could not convert argument 2 to function!");
return false;
}