André Bargull (2014-06-12T22:16:42.000Z)
> On Jun 12, 2014, at 2:36 PM, Erik Arvidsson wrote:
>
> >/  Somehow I missed when we decided to allow null/undefined as the iterable value in for-of loops.
> />/  
> />/  The following test passes using the spec algorithms:
> />/  
> />/  var c = 0;
> />/  for (var x of null) {
> />/    c++;
> />/  }
> />/  assert.equal(c, 0);
> />/  
> />/  However, if we get a null value here we are most likely just masking an user bug.
> />/  
> />/  I assume the justification is that for-in allows null here? However, for-of is new syntax and we have the chance to get this right this time around.
> /
> Yup, there was an issue that was reported and fixed fairly recently pointing out that for-of was inconsistent with for-in in this respect.

for-of statement iteration always ignored undefined/null (always = since 
it was added in rev6). I've only requested in [1] to align for-of 
iteration in statements and comprehensions to have the same behaviour 
w.r.t. undefined/null.


[1] https://bugs.ecmascript.org/show_bug.cgi?id=273

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140613/f3f03d42/attachment.html>
domenic at domenicdenicola.com (2014-06-17T20:50:07.242Z)
> Yup, there was an issue that was reported and fixed fairly recently pointing out that for-of was inconsistent with for-in in this respect.

for-of statement iteration always ignored undefined/null (always = since 
it was added in rev6). I've only requested in https://bugs.ecmascript.org/show_bug.cgi?id=273 to align for-of 
iteration in statements and comprehensions to have the same behaviour 
w.r.t. undefined/null.
domenic at domenicdenicola.com (2014-06-17T20:49:41.538Z)
> Yup, there was an issue that was reported and fixed fairly recently pointing out that for-of was inconsistent with for-in in this respect.

for-of statement iteration always ignored undefined/null (always = since 
it was added in rev6). I've only requested in https://bugs.ecmascript.org/show_bug.cgi?id=2737 to align for-of 
iteration in statements and comprehensions to have the same behaviour 
w.r.t. undefined/null.
domenic at domenicdenicola.com (2014-06-17T20:49:22.157Z)
> Yup, there was an issue that was reported and fixed fairly recently pointing out that for-of was inconsistent with for-in in this respect.

for-of statement iteration always ignored undefined/null (always = since 
it was added in rev6). I've only requested in https://bugs.ecmascript.org/show_bug.cgi?id=273 to align for-of 
iteration in statements and comprehensions to have the same behaviour 
w.r.t. undefined/null.