[Harmony Proxies] Proposal: Property fixing

Brendan Eich brendan at mozilla.com
Wed May 18 08:50:06 PDT 2011

On May 18, 2011, at 7:45 AM, Mark S. Miller wrote:

> On Wed, May 18, 2011 at 7:38 AM, Brendan Eich <brendan at mozilla.com> wrote:
> On May 18, 2011, at 7:28 AM, Tom Van Cutsem wrote:
> > Proxies do coerce all property names to strings, e.g. proxy[obj] will trigger the 'get' trap with 'obj' coerced to a String. This is not actually enforced by the proxy spec, but rather by ES5 (e.g. [[Get]] assumes that its argument P is bound to a property name (a String)). At one point we suggested removing this restriction, so that "proxy[obj]" would give the get trap direct access to obj (which would be particularly useful when intercepting numeric indices on array-like proxies). IIRC, we didn't pursue this option since engines rely on property names being strings in other places, and widening the type of property names to cover arbitrary objects would be problematic.
> SpiderMonkey has a wider internal property name type, which can accomodate at least int and object names. The int case is an optimization, commonly done. The object case is for E4X and perhaps private names.
> Oliver wrote in the thread at the time that he thought allowing any value to be used as a property name (in brackets) and passed through uncoerced to proxies was implementable without trouble for JavaScriptCore, IIRC.
> That's the opposite of my memory, but it was a long time ago. 

I was thinking of


at least. Probably some IRC convo after that as well, but at least that.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110518/4eb0f634/attachment-0001.html>

More information about the es-discuss mailing list