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

@ -512,14 +512,17 @@ ErrorObject::createProto(JSContext* cx, JSProtoKey key)
{
JSExnType type = ExnTypeFromProtoKey(key);
if (type == JSEXN_ERR)
return cx->global()->createBlankPrototype(cx, &ErrorObject::protoClasses[JSEXN_ERR]);
if (type == JSEXN_ERR) {
return GlobalObject::createBlankPrototype(cx, cx->global(),
&ErrorObject::protoClasses[JSEXN_ERR]);
}
RootedObject protoProto(cx, GlobalObject::getOrCreateErrorPrototype(cx, cx->global()));
if (!protoProto)
return nullptr;
return cx->global()->createBlankPrototypeInheriting(cx, &ErrorObject::protoClasses[type],
return GlobalObject::createBlankPrototypeInheriting(cx, cx->global(),
&ErrorObject::protoClasses[type],
protoProto);
}