archives

« Bugzilla Issues Index

#3214 — Replace CheckIterable(_) with GetMethod(_, @@iterator)


Usually, when an optional method is to be fetched, the spec uses the GetMethod abstract operation (this is currently the case for proxy traps, @@toPrimitive, @@create, and @@hasInstance methods); one exception is @@iterator, where CheckIterable/GetIterator is used instead.

In order to be more consistent and to simplify slightly the spec, one can replace calls to CheckIterable(...) with calls to GetMethod(..., @@iterator). The minor differences are:

* One should make sure that the assertion found at step 1 of GetMethod is verified;
* `null` will treated the same way as `undefined`;
* if a value that is neither undefined/null nor a function is found, the corresponding TypeError will be thrown immediately, rather than at the time the GetIterator(...) operation will be (almost inevitably) called.


fixed in rev30 editor's draft


fixed in rev30