Decoupling [ ] and Property Access and the DOM (Was: Why not NodeList#forEach :\?)

Brendan Eich brendan at mozilla.org
Tue Jun 19 10:12:19 PDT 2012


Erik Arvidsson wrote:
> document.forms[0].bar instead of document.forms[0]['bar']
> frames.foo instead of frames['foo']

How does Allen's strawman preclude these? You can have .foo and .bar by 
the usual means, as properties (lazy if proxied). You can alias indexes 
to them using @elementGet and @elementSet if those hooks are invoked for 
any bracket-indexed access, whatever the type of the expression in brackets.

/be


More information about the es-discuss mailing list