Will `for (var a of null) {}` throw an error?

Gary Guo nbdd0121 at hotmail.com
Mon Dec 22 23:35:43 PST 2014

> Date: Mon, 22 Dec 2014 21:28:54 -0800
> From: brendan at mozilla.org
> Your suggestion breaks Array.from and TypedArrayFrom.

In the spec:
> 8. Let arrayLike be ToObject(items).
A type error will also be thrown since null and undefined are not ObjectCoercible. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141223/f20075ae/attachment.html>

More information about the es-discuss mailing list