« Bugzilla Issues Index

#1597 — Array Iterator needs to defined [[Call]] behavior

One can get access to the constructor for the Array Iterator but the semantics of [[Call]] is not defined.

Array Iterator is neither a Constructor nor Callable, so I don't think [[Call]] (or [[Construct]]) needs to be defined at all. There is an empty "ArrayIterator.prototype.constructor" ( entry, which needs to be removed, but that's it. Unless the current draft is incomplete and Array Iterator is supposed to be callable/constructable, of course.

The current implementation for Array Iterator in V8 provides access to a constructor, but that is a different issue.

There is a margin note in the doc file that says we need to decide whether we to expose this 'constructor' property and hence whether we want to make ArrayIterator visible.

I may be useful for user who want to create array-like abstrations. In the spec. we reuse it for typed array iteration.

we ended up not exposing an ArrayIterator constructor (same for other built-in iterators)