Tom Van Cutsem (2013-10-21T14:20:18.000Z)
domenic at domenicdenicola.com (2013-10-26T03:15:49.884Z)
2013/10/18 Allen Wirfs-Brock <allen at wirfs-brock.com> > 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?)