Erik Arvidsson (2012-12-31T18:33:28.000Z)
github at esdiscuss.org (2013-07-12T02:26:06.501Z)
On Sun, Dec 30, 2012 at 6:05 PM, Brandon Benvie <brandon at brandonbenvie.com> wrote: > The primary issue is that most array-likes aren't array-like when it comes > to mutability. Most exposed indexed objects don't allow changes to their > indices, which is decidedly un-array-like for ~quarter of array operations. The issue is not about the mutation methods even though it is non sensical to call push on an immutable array. > It would be useful for there to be a separate "Indexed" class/prototype that > contained the Array methods that don't mutate `this`, which Arguments and > NodeLists and a bunch of other stuff could inherit from, which would also > prevent backward compat issues with testing for instanceof Array. That would not help in the case with `NodeList`. The fix there would be to have concat not do a brand check on its arguments. Allen has outlined the problematic brand checks at http://wiki.ecmascript.org/doku.php?id=strawman:es5_internal_nominal_typing