Bug 975589, part 1 - Rename js::DefineConstructorAndPrototype -> GlobalObject::initBuiltinConstructor and refactor it a bit. r=jwalden.
This commit is contained in:
@@ -2005,8 +2005,11 @@ GlobalObject::initIteratorClasses(JSContext *cx, Handle<GlobalObject *> global)
|
||||
return false;
|
||||
if (!DefinePropertiesAndBrand(cx, iteratorProto, nullptr, iterator_methods))
|
||||
return false;
|
||||
if (!DefineConstructorAndPrototype(cx, global, JSProto_Iterator, ctor, iteratorProto))
|
||||
if (!GlobalObject::initBuiltinConstructor(cx, global, JSProto_Iterator,
|
||||
ctor, iteratorProto))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
RootedObject proto(cx);
|
||||
@@ -2068,8 +2071,8 @@ GlobalObject::initIteratorClasses(JSContext *cx, Handle<GlobalObject *> global)
|
||||
if (!proto || !JSObject::freeze(cx, proto))
|
||||
return false;
|
||||
|
||||
/* This should use a non-JSProtoKey'd slot, but this is easier for now. */
|
||||
if (!DefineConstructorAndPrototype(cx, global, JSProto_StopIteration, proto, proto))
|
||||
// This should use a non-JSProtoKey'd slot, but this is easier for now.
|
||||
if (!GlobalObject::initBuiltinConstructor(cx, global, JSProto_StopIteration, proto, proto))
|
||||
return false;
|
||||
|
||||
global->setConstructor(JSProto_StopIteration, ObjectValue(*proto));
|
||||
|
||||
Reference in New Issue
Block a user