2013/10/18 Allen Wirfs-Brock <[email protected]>

> This is what I currently have in my working draft of the ES6 spec:
>
> [...]
>
> In other words:
>   you can say:
>        Proxy(traget,handler)
>   but not
>         new Proxy(target, handler)
>
> It would be easy enough to allow
>         new Proxy(target,handler)
> but I'm not sure it is the best way to expose the Proxy abstraction .
>
> Proxy really isn't a "class".  There is no Proxy.prototype object and  obj
> instanceof Proxy isn't useful. Also the @@create protocol really isn't
> right for instantiating Proxies.  Subclassing a Proxy isn't going to give
> you anything that is useful.
>

I agree with your line of reasoning and I would be happy if proxies can be
created without `new`. However, I don't see how the above spec disallows
the use of `new`. With the above definition, won't `new Proxy(target,
handler)` just work? (since the Proxy function just ignores its
`this`-binding?)

Regards,
Tom
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to