Re: Why does legacy content break when making array-likes real arrays?

2012-12-31 Thread Erik Arvidsson
On Sun, Dec 30, 2012 at 6:05 PM, Brandon Benvie bran...@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

Re: Why does legacy content break when making array-likes real arrays?

2012-12-31 Thread Brandon Benvie
True, concat specifically needs to be changed. But it is the only Array method that does that check (the only other internal checks for brand BuiltinArray are in apply and isArray I think). On Mon, Dec 31, 2012 at 1:33 PM, Erik Arvidsson erik.arvids...@gmail.comwrote: On Sun, Dec 30, 2012 at

Re: Why does legacy content break when making array-likes real arrays?

2012-12-31 Thread Allen Wirfs-Brock
On Dec 31, 2012, at 10:39 AM, Brandon Benvie wrote: True, concat specifically needs to be changed. But it is the only Array method that does that check (the only other internal checks for brand BuiltinArray are in apply and isArray I think). In support of Array subclassing, I have a tweak

Re: Why does legacy content break when making array-likes real arrays?

2012-12-31 Thread Brandon Benvie
The work so far in the spec on enabling subclassing has been awesome and I look forward to seeing this! On Mon, Dec 31, 2012 at 1:52 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: In support of Array subclassing, I have a tweak to concat that allows properly formed subclasses of Array to

Why does legacy content break when making array-likes real arrays?

2012-12-30 Thread Domenic Denicola
From: es-discuss-boun...@mozilla.org [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Anne van Kesteren Sent: Sunday, December 30, 2012 17:18 On Sun, Dec 30, 2012 at 10:22 PM, Axel Rauschmayer a...@rauschma.de wrote: 5. Array-like objects [not completely fixed (DOM...), but

Re: Why does legacy content break when making array-likes real arrays?

2012-12-30 Thread Anne van Kesteren
On Sun, Dec 30, 2012 at 11:23 PM, Domenic Denicola dome...@domenicdenicola.com wrote: I saw this happen, and was sad, but never understood what the legacy problem was. https://bugs.webkit.org/show_bug.cgi?id=81573 In particular https://bugs.webkit.org/show_bug.cgi?id=81573#c45 The problem

Re: Why does legacy content break when making array-likes real arrays?

2012-12-30 Thread Brendan Eich
Domenic Denicola wrote: From: es-discuss-boun...@mozilla.org [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Anne van Kesteren Sent: Sunday, December 30, 2012 17:18 On Sun, Dec 30, 2012 at 10:22 PM, Axel Rauschmayera...@rauschma.de wrote: 5. Array-like objects [not completely fixed

Re: Why does legacy content break when making array-likes real arrays?

2012-12-30 Thread Erik Arvidsson
The problem was code that incorrectly assumed instanceof to mean that the instance was an Array in combination with Array.prototype.concat. There was a bug in Google's Closure Library which caused almost all Google's apps to fail due to this. The library was updated as soon as this was found but

Re: Why does legacy content break when making array-likes real arrays?

2012-12-30 Thread Erik Arvidsson
To clarify, my message was about making NodeLists have Array.prototype in its prototype chain. On Dec 30, 2012 5:50 PM, Erik Arvidsson erik.arvids...@gmail.com wrote: The problem was code that incorrectly assumed instanceof to mean that the instance was an Array in combination with

Re: Why does legacy content break when making array-likes real arrays?

2012-12-30 Thread Brandon Benvie
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. It would be useful for there to be a separate Indexed class/prototype that