[Harmony Proxies] Proposal: Property fixing

Mark S. Miller erights at google.com
Wed May 18 07:45:15 PDT 2011

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. Oliver?

> /be
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

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

More information about the es-discuss mailing list