decoupling [ ] and property access for collections

Waldemar Horwat waldemar at google.com
Thu Nov 3 14:06:41 PDT 2011


We had this in ES4, together with the provision that you could have multiple arguments between the [], so you could define data structures that can be addressed as:

   matrix2d[x, y]

As in here, this would default to the ES5 semantics on objects that don't have the new [] proxy handler.

Overall, I like it.  You're already familiar with the main issues that this brings up, such as usage cases where folks want a reliable way of indirectly accessing . properties without hitting the [] proxy.  A method call syntax for that would be fine.

     Waldemar


More information about the es-discuss mailing list