Proxies fail comparison operator

Oriol _ oriol-bugzilla at
Thu Mar 30 20:00:46 UTC 2017

> Isn't the purpose of the proxy to be exchanged with the original, without any negative side effects?

This is not possible. Proxies do not reflect internal slots, so for example, in a browser,

var obj = document;
var proxy = new Proxy(obj, {});, obj); // true, proxy); // TypeError: 'contains' called on an object that does not implement interface Node.

So it would be bad if `obj === proxy` returned true but the values had different behaviors. I think `+0 === -0` despite `1/+0 !== 1/-0` is already enough of a nightmare.

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

More information about the es-discuss mailing list