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

@ -1005,15 +1005,16 @@ js::InitNumberClass(JSContext* cx, HandleObject obj)
/* XXX must do at least once per new thread, so do it per JSContext... */
FIX_FPU();
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
Handle<GlobalObject*> global = obj.as<GlobalObject>();
RootedObject numberProto(cx, global->createBlankPrototype(cx, &NumberObject::class_));
RootedObject numberProto(cx, GlobalObject::createBlankPrototype(cx, global,
&NumberObject::class_));
if (!numberProto)
return nullptr;
numberProto->as<NumberObject>().setPrimitiveValue(0);
RootedFunction ctor(cx);
ctor = global->createConstructor(cx, Number, cx->names().Number, 1);
ctor = GlobalObject::createConstructor(cx, Number, cx->names().Number, 1);
if (!ctor)
return nullptr;