Function proxies without explicit construct trap

Tom Van Cutsem at
Tue Nov 15 20:03:55 PST 2011

Earlier I wrote:

All good points, and I don't recall any of them being intentional. Your
> points seem to suggest changing the semantics such that calling "new
> fproxy()" on a function proxy without a construct trap should perhaps just
> simply throw a TypeError.

Looking at the problem again, the way in which [[Construct]] for function
proxies should have been specced is that if no constructTrap is present,
the function proxy should default to the built-in [[Construct]] algorithm
for Functions (ES5 section 13.2.2, with F now being a function proxy),
rather than calling the callTrap's [[Construct]] method.

This will trigger the "get" trap of the function proxy, to lookup the
"prototype" property, and the new instance will inherit from that.

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

More information about the es-discuss mailing list