Nov 17 meeting notes

David Herman dherman at mozilla.com
Thu Nov 17 20:06:55 PST 2011


On Nov 17, 2011, at 5:20 PM, Rick Waldron wrote:

> On Thu, Nov 17, 2011 at 7:40 PM, Waldemar Horwat <waldemar at google.com> wrote:
> Array.from(a) is superfluous because it's expressed even simpler as
> [... a].  DaveH withdrew it.
> 
> Perhaps Array.from() was either misunderstood or miscommunicated. I had prepared a complete step-by-step production of the function's semantics and documented them here:

It turns out that [...arrayLikeThingy] does exactly the same thing; it constructs a new Array from the contents of any array-like object.

> https://gist.github.com/1074126
> 
> These steps support back compat to older JS (and DOM) implementations for converting _any_ array looking object (arguments, DOM NodeLists, DOMTokenList (classList), typed arrays... etc.) into a new instance of a real array. 
> 
> This is a real problem, in real JavaScript, in the real world. Considering the positive response from actual developers in the JS community, I'd like to ask that it be reconsidered.

The reason why we decided to table the statics was that we had some serious questions about inheritance of statics and how they should behave, which is part of the ongoing discussions about classes. Given that spread (the ... syntax) gives you exactly the behavior you want, and it's actually very clear and even more concise than Array.from, it didn't seem worth taking more time discussing it now.

Dave

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111117/c156a957/attachment.html>


More information about the es-discuss mailing list