mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-23 12:53:07 +09:00
1320408 - Part 14: Change some GlobalObject methods to static method.
This commit is contained in:
parent
b237ae6437
commit
cc8cb910dd
37 changed files with 287 additions and 259 deletions
|
|
@ -1022,7 +1022,7 @@ JS_ResolveStandardClass(JSContext* cx, HandleObject obj, HandleId id, bool* reso
|
|||
CHECK_REQUEST(cx);
|
||||
assertSameCompartment(cx, obj, id);
|
||||
|
||||
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
*resolved = false;
|
||||
|
||||
if (!JSID_IS_ATOM(id))
|
||||
|
|
@ -1066,10 +1066,7 @@ JS_ResolveStandardClass(JSContext* cx, HandleObject obj, HandleId id, bool* reso
|
|||
// more way: its prototype chain is lazily initialized. That is,
|
||||
// global->getProto() might be null right now because we haven't created
|
||||
// Object.prototype yet. Force it now.
|
||||
if (!global->getOrCreateObjectPrototype(cx))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return GlobalObject::getOrCreateObjectPrototype(cx, global);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
|
|
@ -1102,8 +1099,7 @@ JS_EnumerateStandardClasses(JSContext* cx, HandleObject obj)
|
|||
AssertHeapIsIdle(cx);
|
||||
CHECK_REQUEST(cx);
|
||||
assertSameCompartment(cx, obj);
|
||||
MOZ_ASSERT(obj->is<GlobalObject>());
|
||||
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
return GlobalObject::initStandardClasses(cx, global);
|
||||
}
|
||||
|
||||
|
|
@ -1159,7 +1155,8 @@ JS_GetObjectPrototype(JSContext* cx, HandleObject forObj)
|
|||
{
|
||||
CHECK_REQUEST(cx);
|
||||
assertSameCompartment(cx, forObj);
|
||||
return forObj->global().getOrCreateObjectPrototype(cx);
|
||||
Rooted<GlobalObject*> global(cx, &forObj->global());
|
||||
return GlobalObject::getOrCreateObjectPrototype(cx, global);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
|
|
@ -1167,7 +1164,8 @@ JS_GetFunctionPrototype(JSContext* cx, HandleObject forObj)
|
|||
{
|
||||
CHECK_REQUEST(cx);
|
||||
assertSameCompartment(cx, forObj);
|
||||
return forObj->global().getOrCreateFunctionPrototype(cx);
|
||||
Rooted<GlobalObject*> global(cx, &forObj->global());
|
||||
return GlobalObject::getOrCreateFunctionPrototype(cx, global);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
|
|
@ -6015,7 +6013,8 @@ JS_SetRegExpInput(JSContext* cx, HandleObject obj, HandleString input)
|
|||
CHECK_REQUEST(cx);
|
||||
assertSameCompartment(cx, input);
|
||||
|
||||
RegExpStatics* res = obj->as<GlobalObject>().getRegExpStatics(cx);
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
RegExpStatics* res = GlobalObject::getRegExpStatics(cx, global);
|
||||
if (!res)
|
||||
return false;
|
||||
|
||||
|
|
@ -6030,7 +6029,8 @@ JS_ClearRegExpStatics(JSContext* cx, HandleObject obj)
|
|||
CHECK_REQUEST(cx);
|
||||
MOZ_ASSERT(obj);
|
||||
|
||||
RegExpStatics* res = obj->as<GlobalObject>().getRegExpStatics(cx);
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
RegExpStatics* res = GlobalObject::getRegExpStatics(cx, global);
|
||||
if (!res)
|
||||
return false;
|
||||
|
||||
|
|
@ -6045,7 +6045,8 @@ JS_ExecuteRegExp(JSContext* cx, HandleObject obj, HandleObject reobj, char16_t*
|
|||
AssertHeapIsIdle(cx);
|
||||
CHECK_REQUEST(cx);
|
||||
|
||||
RegExpStatics* res = obj->as<GlobalObject>().getRegExpStatics(cx);
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
RegExpStatics* res = GlobalObject::getRegExpStatics(cx, global);
|
||||
if (!res)
|
||||
return false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue