archives

« Bugzilla Issues Index

#1870 — for-of iteration should not ToObject() returned iterator


11.1.4.2 Array Comprehension
Runtime Semantics: QualifierEvaluation
ComprehensionFor : for (ForBinding of AssignmentExpression )
- step 6


12.6.4.2 Runtime Semantics
Runtime Semantics: For In/Of Expression Evaluation Abstract Operation
- step 7c


There is little use (*) calling ToObject() on the return value from the @@iterator invocation. I'd suggest replacing these steps with a call to 15.19.4.3.5 GetIterator(obj).


(*) It is unlikely to install a "next" method on primitive wrappers and let primitive wrappers act like an Iterator.


fixed in rev20 editor's draft


fixed in rev20 draft, Oct. 28, 2013