Bug 975589, part 1 - Rename js::DefineConstructorAndPrototype -> GlobalObject::initBuiltinConstructor and refactor it a bit. r=jwalden.

This commit is contained in:
Jason Orendorff
2014-03-10 16:29:40 -05:00
parent b84c508dc5
commit 1f7f9f3949
15 changed files with 58 additions and 63 deletions

View File

@@ -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));