mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 14:28:39 +09:00
1320408 - Part 14: Change some GlobalObject methods to static method.
This commit is contained in:
parent
b237ae6437
commit
cc8cb910dd
37 changed files with 287 additions and 259 deletions
|
|
@ -2914,17 +2914,17 @@ js::InitStringClass(JSContext* cx, HandleObject obj)
|
|||
{
|
||||
MOZ_ASSERT(obj->isNative());
|
||||
|
||||
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
|
||||
Handle<GlobalObject*> global = obj.as<GlobalObject>();
|
||||
|
||||
Rooted<JSString*> empty(cx, cx->runtime()->emptyString);
|
||||
RootedObject proto(cx, global->createBlankPrototype(cx, &StringObject::class_));
|
||||
RootedObject proto(cx, GlobalObject::createBlankPrototype(cx, global, &StringObject::class_));
|
||||
if (!proto || !proto->as<StringObject>().init(cx, empty))
|
||||
return nullptr;
|
||||
|
||||
/* Now create the String function. */
|
||||
RootedFunction ctor(cx);
|
||||
ctor = global->createConstructor(cx, StringConstructor, cx->names().String, 1,
|
||||
AllocKind::FUNCTION, &jit::JitInfo_String);
|
||||
ctor = GlobalObject::createConstructor(cx, StringConstructor, cx->names().String, 1,
|
||||
AllocKind::FUNCTION, &jit::JitInfo_String);
|
||||
if (!ctor)
|
||||
return nullptr;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue