1320408 - Part 14: Change some GlobalObject methods to static method.

This commit is contained in:
Gaming4JC 2019-06-08 23:28:04 -04:00 • committed by Roy Tam
commit cc8cb910dd
37 changed files with 287 additions and 259 deletions

View file

@ -1985,7 +1985,8 @@ js::GetObjectFromIncumbentGlobal(JSContext* cx, MutableHandleObject obj)
{
AutoCompartment ac(cx, globalObj);
obj.set(globalObj->as<GlobalObject>().getOrCreateObjectPrototype(cx));
Handle<GlobalObject*> global = globalObj.as<GlobalObject>();
obj.set(GlobalObject::getOrCreateObjectPrototype(cx, global));
if (!obj)
return false;
}
@ -2548,7 +2549,7 @@ js::SetPrototype(JSContext* cx, HandleObject obj, HandleObject proto, JS::Object
// [[Prototype]] chain is always properly immutable, even in the presence
// of lazy standard classes.
if (obj->is<GlobalObject>()) {
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
Handle<GlobalObject*> global = obj.as<GlobalObject>();
if (!GlobalObject::ensureConstructor(cx, global, JSProto_Object))
return false;
}