Closed Bug 929104 Opened 12 years ago Closed 12 years ago

The Array Iterator prototype is not an Array Iterator

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 924059

People

(Reporter: jorendorff, Unassigned)

Details

The object returned by GlobalObject::getOrCreateArrayIteratorPrototype should have the default Class, &JSObject::class_. (The spec doesn't give this object any of the internal data properties that ArrayIterators have. Call this object's non-generic methods should throw a TypeError.) load(libdir + "iteration.js"); var aip = Object.getPrototypeOf([][std_iterator]()); assertEq(Object.prototype.toString.call(aip), "[object Object]");
Sorry, that's a bogus test. toString.call(aip) should return "[object Array Iterator]", but aip still isn't an array iterator, so: assertThrowsInstanceOf(() => aip.next(), TypeError); This already throws a TypeError, sort of by accident. The error message is bogus: js> aip.next() typein:11:0 TypeError: a is undefined should be something about calling a non-generic method on an incompatible prototype object.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.