Gary Guo (2014-12-22T13:29:40.000Z)
On Mon, 22 Dec 2014 21:06:18 +0800, Glen Huang <curvedmark at gmail.com> wrote:>Ideally it shouldn’t, because its twin `for (var a in null) {}` won’t.
>
>But looking at step 8 in https://people.mozilla.org/~jorendorff/es6-draft.html#sec-runtime-semantics-forin-div-ofexpressionevaluation-abstract-operation, when passing `null` to `GetIterator()`, it will throw a type error when the result of step 2 `CheckIterable(null)`, which is `undefind`, is called in step 3 in the algorithm for `GetIterator()`.>
>Did I miss something or the current spec does throw an error?

To me since `IsCallable(undefined)` is `false`, so it throws an `TypeError`. Traceur and V8 will both throw a `TypeError` saying that cannot read property @@iterator from undefined or null, and Firefox throws a `TypeError` saying that null have no property. So it should be an error. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141222/4aa55317/attachment.html>
d at domenic.me (2015-01-05T21:14:15.823Z)
To me since `IsCallable(undefined)` is `false`, so it throws an `TypeError`. Traceur and V8 will both throw a `TypeError` saying that cannot read property @@iterator from undefined or null, and Firefox throws a `TypeError` saying that null have no property. So it should be an error.