> On Jun 8, 2017, at 11:32 AM, Tab Atkins Jr. <[email protected]> wrote:
> 
> Naively, this requires a Proxy, so we can intercept uses of the []
> syntax.  However, we don't need all the rest of the Proxy
> functionality, just this one intercept - a setter function, just for
> `obj[foo]` rather than `obj.foo`.  Further, Typed Arrays already have
> *precisely* the functionality I'd like to use - they intercept setting
> using [], and convert it into the appropriate type of number.  AWB
> also proposed adding exactly this hook in the past (I think it was
> called "Array reformation" or something?).

that proposal page can be access here: 
https://web.archive.org/web/20160425220917/http://wiki.ecmascript.org/doku.php?id=strawman:object_model_reformation
 
<https://web.archive.org/web/20160425220917/http://wiki.ecmascript.org/doku.php?id=strawman:object_model_reformation>
 

the basic idea was that distinct internal methods (Proxy traps) are used for . 
and [] property accesses and that the default behavior for [ ] accesses is to 
look for specific symbol-keyed methods and if found defer the access logic to 
the method.  If not found the behavior is the same as for . accesses.

Allen
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to