archives

« Bugzilla Issues Index

#2737 — 12.2.4.2.4 ComprehensionComponentEvaluation, 13.6.4.6 ForIn/OfExpressionEvaluation: Align behaviour for iteration over undefined/null?


12.2.4.2.4 Runtime Semantics: ComprehensionComponentEvaluation
13.6.4.6 Runtime Semantics: ForIn/OfExpressionEvaluation Abstract Operation

for-of statement iteration follows the legacy for-in statement behaviour w.r.t to undefined/null, that means undefined/null values are silently ignored. Comprehension iteration throws a type error for undefined/null.

It may make sense to give the same behaviour for any for-of iteration, may it be in a for-of statement or in a for-of comprehension. To provide the same behaviour in for-of statement as in for-in statement seems less important.


fixed in rev25 editor's draft

made comprehensions do 0 iterations if value of for-of expression is undefined or null to be consistent with for-in/of statements.


fixed in rev25 editor's draft


Didn't you reverse this? Reopen, or new bug with bug # citation here?

/be


(In reply to comment #3)
> Didn't you reverse this? Reopen, or new bug with bug # citation here?

yes, made the edit yesterday.


This changed was backed out in rev26 along with removing the similar behavior for for-of based upon TC39 review of the issue.

Changing to resolved-wontfix