ECMA TC 39 / W3C HTML and WebApps WG coordination

Waldemar Horwat waldemar at
Fri Sep 25 18:43:52 PDT 2009

Maciej Stachowiak wrote:
> Perhaps when catchalls are considered for ECMAScript, there could b a 
> way to encapsulate the specific pattern of index access, so you can have 
> magical getters and setters for all index properties (integer numbers in 
> range to be an array index) without having to install a full catchall 
> for all properties.

That's what ES4 did.  The a[b] operator could be overridden by an object, as could for-in iteration.  Hence you could implement array-like things (multidimensional in the case of ES4 because it also understood a[b,c,d]) without doing catch-alls.

This seems like an attractive avenue, especially since we now have some ES5 methods that reliably access underlying properties.


More information about the es-discuss mailing list