> On 19 Feb 2015, at 21:09, Andrea Giammarchi <andrea.giammar...@gmail.com> > wrote: > > if we'd like to have Array.empty, Function.empty, String.empty and friends, > what's wrong with having these as we always had already: as prototypes?
I find it more self-explanatory. Here, prototypes are taking on a role that they don’t usually have: they are empty instances of “their” constructors. A much more important reason, though, is that you want to freeze everything `*.empty`, because these instances will get shared and then mutability is a problem. However, you can’t freeze `Array.prototype`. Greetings, Axel -- Dr. Axel Rauschmayer a...@rauschma.de rauschma.de
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss