ecma262 icon indicating copy to clipboard operation
ecma262 copied to clipboard

ArrayIterator and RegExpStringIterator are no longer reentrant

Open anba opened this issue 2 years ago • 0 comments

#2045 made ArrayIterator and RegExpStringIterator no longer reentrant, which doesn't match implementations.

The following test case should throw a TypeError per the current spec, but does throw "unreachable" in all engines.

let obj = {
  get 0() {
    it.next(); // <-- Should throw a TypeError per current spec!
  },
  get 1() {
    throw "unreachable"; // <-- Unreachable per current spec.
  },
  length: 2,
};
let it = Array.prototype.values.call(obj);
[...it];

Relevant steps:

anba avatar Jul 28 '23 07:07 anba