On Nov 12, 2014, at 11:58 AM, Jeremy Martin wrote:

> My opinion is that array testing is fundamental to core JS and is worth the 
> exception.
> 
> Knowing that Array.isArray() tests fail for proxies, I'd be afraid to ever 
> create a Proxy for an array that I don't control the complete lifecycle of. 
> That seems to critically inhibit the usefulness of Proxies, especially when 
> transparency seems to have been an intended characteristic of them going all 
> the way back to the strawman days.

Proxies are not transparent forwarders!  In particular their default handling 
of the `this` value on method invokes will break any built-in method that needs 
to access "internal slots" of an object.

```js
var p = new Proxy(new Array, {});
```
will give you an object that will fail on serval of the Array.prototype methods.

It is even worse for other built-ins such as Map or the typed array 
constructors.

Allen

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

Reply via email to