Function proxy length (Was: length property value for functions with parameter enhancements)

Andreas Rossberg rossberg at
Wed Aug 31 06:48:31 PDT 2011

On 31 August 2011 15:21, Tom Van Cutsem < at> wrote:

> I coded up a hypothetical Proxy.createConstructor function that creates a
> function proxy initialized according to ES5.1 section 13.2: <

Nit: invoking assumes that callTrap has an actual call method.
But you want to work this for call traps that are themselves proxies and
don't necessarily have that (or don't we?). So you need to do, instance, arguments)

(assuming nobody messed with that either, of course).

This turns up quite frequently, in fact. With proxies, it is really
error-prone that all these functions have been made available as methods on
{Object,Function}.prototype, instead of being separate. Morally, these
methods used to be part of the implicit contracts of object and function
types that everybody relies on. But proxies break those contracts! At least
for functions, this is really a problem IMO (for plain objects, the contract
was already invalidated by allowing Object.create(null)).

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

More information about the es-discuss mailing list