C. Scott Ananian (2014-06-11T16:50:39.000Z)
domenic at domenicdenicola.com (2014-06-20T19:25:54.680Z)
On Wed, Jun 11, 2014 at 12:44 PM, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote: > Array.from and Array.of have a non-throwing IsConstrutor test because they are designed to allow things like this: > > ```js > let of = Array.of; > of(1,2,3,4,5); //Equivalent to: Array.of(1,2,3,4,5) > ``` > > I don't recall why we provided that functionality. It doesn't seem to me like a pattern we should want to encourage. Why not just require: ```javascript let of = Array.of.bind(Array); of(1,2,3,4,5); ``` That seems like it would work just as well, and not require special handling in the spec. > I'd be happy to eliminate the special handling in Array.of and Array.from if there is consensus that it isn't desirable. I don't need it. (Although `es6-shim` currently seems to implement the special handling correctly.)