1320408 - Part 18: Change StringObject::init to static method.

This commit is contained in:
Gaming4JC 2019-06-08 23:46:41 -04:00 committed by Roy Tam
commit 3fb93ffdf6
3 changed files with 13 additions and 12 deletions

View file

@ -2918,7 +2918,10 @@ js::InitStringClass(JSContext* cx, HandleObject obj)
Rooted<JSString*> empty(cx, cx->runtime()->emptyString);
RootedObject proto(cx, GlobalObject::createBlankPrototype(cx, global, &StringObject::class_));
if (!proto || !proto->as<StringObject>().init(cx, empty))
if (!proto)
return nullptr;
Handle<StringObject*> protoObj = proto.as<StringObject>();
if (!StringObject::init(cx, protoObj, empty))
return nullptr;
/* Now create the String function. */