Re: David’s ProxyMap

Axel Rauschmayer axel at
Sat Oct 20 10:59:42 PDT 2012

> 1. Accidentally accessing inherited properties: fixed
> 2. Can’t safely invoke methods, because those might be overridden: still a problem (right?)
> 3. __proto__: fixed
> [...]
> About your second point, it assumes that we want all objects to have Object.prototype methods. I'm not so sure it should be a goal.

It’s loosely related to Allen’s object model reformation [1]: you’d want the [] “operator” to get and set collection elements, but would still want to be able to invoke map-related methods. Currently, the two are mutually exclusive.

Another idea: one could use the `in` operator to check whether a key exists in the map (only for ProxyMap at the moment, possibly for all collections in the future).

Currently, proxies make no distinction between a property read access and a method invocation. In my experience, it would be nice if that distinction would be there – if only that one didn’t have to curry for method invocations which must be a performance issue and is a fairly common use case (remotely invoking web services etc.). Now, there are reasons against this and I’m mainly wondering if actually using the new API has changed your or Tom’s mind.



Dr. Axel Rauschmayer
axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list