Bug 924059. Give ArrayIterator and its prototype different JSClasses so we can't confuse them for each other. r=waldo
This commit is contained in:
@@ -926,6 +926,11 @@ const Class PropertyIteratorObject::class_ = {
|
||||
trace
|
||||
};
|
||||
|
||||
static const Class ArrayIteratorPrototypeClass = {
|
||||
"Array Iterator",
|
||||
JSCLASS_IMPLEMENTS_BARRIERS
|
||||
};
|
||||
|
||||
enum {
|
||||
ArrayIteratorSlotIteratedObject,
|
||||
ArrayIteratorSlotNextIndex,
|
||||
@@ -1335,7 +1340,7 @@ GlobalObject::initIteratorClasses(JSContext *cx, Handle<GlobalObject *> global)
|
||||
|
||||
RootedObject proto(cx);
|
||||
if (global->getSlot(ARRAY_ITERATOR_PROTO).isUndefined()) {
|
||||
const Class *cls = &ArrayIteratorObject::class_;
|
||||
const Class *cls = &ArrayIteratorPrototypeClass;
|
||||
proto = global->createBlankPrototypeInheriting(cx, cls, *iteratorProto);
|
||||
if (!proto || !DefinePropertiesAndFunctions(cx, proto, nullptr, array_iterator_methods))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user