1320408 - Part 9: Change JSObject::setFlags and depending methods to static method.

This commit is contained in:
Gaming4JC 2019-06-08 19:49:29 -04:00 • committed by Roy Tam
commit 7f856ff769
14 changed files with 61 additions and 55 deletions

View file

@ -278,8 +278,11 @@ JSObject::splicePrototype(JSContext* cx, HandleObject obj, const Class* clasp,
// Windows may not appear on prototype chains.
MOZ_ASSERT_IF(proto.isObject(), !IsWindow(proto.toObject()));
if (proto.isObject() && !proto.toObject()->setDelegate(cx))
return false;
if (proto.isObject()) {
RootedObject protoObj(cx, proto.toObject());
if (!JSObject::setDelegate(cx, protoObj))
return false;
}
// Force type instantiation when splicing lazy group.
RootedObjectGroup group(cx, JSObject::getGroup(cx, obj));
@ -346,7 +349,7 @@ JSObject::makeLazyGroup(JSContext* cx, HandleObject obj)
JSObject::setNewGroupUnknown(JSContext* cx, const js::Class* clasp, JS::HandleObject obj)
{
ObjectGroup::setDefaultNewGroupUnknown(cx, clasp, obj);
return obj->setFlags(cx, BaseShape::NEW_GROUP_UNKNOWN);
return JSObject::setFlags(cx, obj, BaseShape::NEW_GROUP_UNKNOWN);
}
/////////////////////////////////////////////////////////////////////
@ -508,7 +511,7 @@ ObjectGroup::defaultNewGroup(ExclusiveContext* cx, const Class* clasp,
if (proto.isObject() && !proto.toObject()->isDelegate()) {
RootedObject protoObj(cx, proto.toObject());
if (!protoObj->setDelegate(cx))
if (!JSObject::setDelegate(cx, protoObj))
return nullptr;
// Objects which are prototypes of one another should be singletons, so