Bug 1225396 part 1 - Rename *Iterator stuff to *LegacyIterator. r=jorendorff

This commit is contained in:
Jan de Mooij 2015-12-09 22:54:10 -05:00
parent cf174cf04d
commit 544e48f726
7 changed files with 20 additions and 20 deletions

View File

@ -141,7 +141,7 @@ MapIteratorObject::kind() const
bool
GlobalObject::initMapIteratorProto(JSContext* cx, Handle<GlobalObject*> global)
{
Rooted<JSObject*> base(cx, GlobalObject::getOrCreateIteratorPrototype(cx, global));
Rooted<JSObject*> base(cx, GlobalObject::getOrCreateLegacyIteratorPrototype(cx, global));
if (!base)
return false;
Rooted<MapIteratorObject*> proto(cx,
@ -866,7 +866,7 @@ SetIteratorObject::kind() const
bool
GlobalObject::initSetIteratorProto(JSContext* cx, Handle<GlobalObject*> global)
{
Rooted<JSObject*> base(cx, GlobalObject::getOrCreateIteratorPrototype(cx, global));
Rooted<JSObject*> base(cx, GlobalObject::getOrCreateLegacyIteratorPrototype(cx, global));
if (!base)
return false;
Rooted<SetIteratorObject*> proto(cx,

View File

@ -1225,7 +1225,7 @@ JS_GetIteratorPrototype(JSContext* cx)
{
CHECK_REQUEST(cx);
Rooted<GlobalObject*> global(cx, cx->global());
return GlobalObject::getOrCreateIteratorPrototype(cx, global);
return GlobalObject::getOrCreateLegacyIteratorPrototype(cx, global);
}
JS_PUBLIC_API(JSObject*)

View File

@ -543,7 +543,7 @@ Compare(T* a, T* b, size_t c)
return true;
}
static bool iterator_next(JSContext* cx, unsigned argc, Value* vp);
static bool legacy_iterator_next(JSContext* cx, unsigned argc, Value* vp);
static inline PropertyIteratorObject*
NewPropertyIteratorObject(JSContext* cx, unsigned flags)
@ -580,7 +580,7 @@ NewPropertyIteratorObject(JSContext* cx, unsigned flags)
// next method on the prototype doesn't break cross-global for .. in.
// We don't have to do this for JSITER_ENUMERATE because that object always
// takes an optimized path.
RootedFunction next(cx, NewNativeFunction(cx, iterator_next, 0,
RootedFunction next(cx, NewNativeFunction(cx, legacy_iterator_next, 0,
HandlePropertyName(cx->names().next)));
if (!next)
return nullptr;
@ -1017,7 +1017,7 @@ IsIterator(HandleValue v)
}
MOZ_ALWAYS_INLINE bool
iterator_next_impl(JSContext* cx, const CallArgs& args)
legacy_iterator_next_impl(JSContext* cx, const CallArgs& args)
{
MOZ_ASSERT(IsIterator(args.thisv()));
@ -1040,15 +1040,15 @@ iterator_next_impl(JSContext* cx, const CallArgs& args)
}
static bool
iterator_next(JSContext* cx, unsigned argc, Value* vp)
legacy_iterator_next(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<IsIterator, iterator_next_impl>(cx, args);
return CallNonGenericMethod<IsIterator, legacy_iterator_next_impl>(cx, args);
}
static const JSFunctionSpec iterator_methods[] = {
static const JSFunctionSpec legacy_iterator_methods[] = {
JS_SELF_HOSTED_SYM_FN(iterator, "LegacyIteratorShim", 0, 0),
JS_FN("next", iterator_next, 0, 0),
JS_FN("next", legacy_iterator_next, 0, 0),
JS_FS_END
};
@ -1468,7 +1468,7 @@ GlobalObject::initArrayIteratorProto(JSContext* cx, Handle<GlobalObject*> global
if (global->getReservedSlot(ARRAY_ITERATOR_PROTO).isObject())
return true;
RootedObject iteratorProto(cx, GlobalObject::getOrCreateIteratorPrototype(cx, global));
RootedObject iteratorProto(cx, GlobalObject::getOrCreateLegacyIteratorPrototype(cx, global));
if (!iteratorProto)
return false;
@ -1497,7 +1497,7 @@ GlobalObject::initStringIteratorProto(JSContext* cx, Handle<GlobalObject*> globa
}
JSObject*
js::InitIteratorClass(JSContext* cx, HandleObject obj)
js::InitLegacyIteratorClass(JSContext* cx, HandleObject obj)
{
Handle<GlobalObject*> global = obj.as<GlobalObject>();
@ -1523,7 +1523,7 @@ js::InitIteratorClass(JSContext* cx, HandleObject obj)
return nullptr;
if (!LinkConstructorAndPrototype(cx, ctor, iteratorProto))
return nullptr;
if (!DefinePropertiesAndFunctions(cx, iteratorProto, nullptr, iterator_methods))
if (!DefinePropertiesAndFunctions(cx, iteratorProto, nullptr, legacy_iterator_methods))
return nullptr;
if (!GlobalObject::initBuiltinConstructor(cx, global, JSProto_Iterator,
ctor, iteratorProto))

View File

@ -214,7 +214,7 @@ extern JSObject*
CreateItrResultObject(JSContext* cx, HandleValue value, bool done);
extern JSObject*
InitIteratorClass(JSContext* cx, HandleObject obj);
InitLegacyIteratorClass(JSContext* cx, HandleObject obj);
extern JSObject*
InitStopIterationClass(JSContext* cx, HandleObject obj);

View File

@ -75,7 +75,7 @@
real(SyntaxError, 16, InitViaClassSpec, ERROR_CLASP(JSEXN_SYNTAXERR)) \
real(TypeError, 17, InitViaClassSpec, ERROR_CLASP(JSEXN_TYPEERR)) \
real(URIError, 18, InitViaClassSpec, ERROR_CLASP(JSEXN_URIERR)) \
real(Iterator, 19, InitIteratorClass, OCLASP(PropertyIterator)) \
real(Iterator, 19, InitLegacyIteratorClass,OCLASP(PropertyIterator)) \
real(StopIteration, 20, InitStopIterationClass, OCLASP(StopIteration)) \
real(ArrayBuffer, 21, InitArrayBufferClass, &js::ArrayBufferObject::protoClass) \
real(Int8Array, 22, InitViaClassSpec, TYPED_ARRAY_CLASP(Int8)) \

View File

@ -453,7 +453,7 @@ class GlobalObject : public NativeObject
TypedObjectModuleObject& getTypedObjectModule() const;
JSObject* getIteratorPrototype() {
JSObject* getLegacyIteratorPrototype() {
return &getPrototype(JSProto_Iterator).toObject();
}
@ -509,8 +509,8 @@ class GlobalObject : public NativeObject
}
public:
static NativeObject* getOrCreateIteratorPrototype(JSContext* cx,
Handle<GlobalObject*> global)
static NativeObject* getOrCreateLegacyIteratorPrototype(JSContext* cx,
Handle<GlobalObject*> global)
{
if (!ensureConstructor(cx, global, JSProto_Iterator))
return nullptr;

View File

@ -448,7 +448,7 @@ intrinsic_GetIteratorPrototype(JSContext* cx, unsigned argc, Value* vp)
CallArgs args = CallArgsFromVp(argc, vp);
MOZ_ASSERT(args.length() == 0);
JSObject* obj = GlobalObject::getOrCreateIteratorPrototype(cx, cx->global());
JSObject* obj = GlobalObject::getOrCreateLegacyIteratorPrototype(cx, cx->global());
if (!obj)
return false;
@ -513,7 +513,7 @@ intrinsic_NewListIterator(JSContext* cx, unsigned argc, Value* vp)
CallArgs args = CallArgsFromVp(argc, vp);
MOZ_ASSERT(args.length() == 0);
RootedObject proto(cx, GlobalObject::getOrCreateIteratorPrototype(cx, cx->global()));
RootedObject proto(cx, GlobalObject::getOrCreateLegacyIteratorPrototype(cx, cx->global()));
if (!proto)
return false;