A proxy object emulates its target because the essential internal methods are 
redirected to the target by default.
However, this does not happen with other internal slots, so I don't see why it 
should be different for private fields.
More examples:

```js
new Number(123).valueOf(); // 123
new Proxy(new Number(123), {}).valueOf(); // TypeError: valueOf method called 
on incompatible Proxy
```

```js
new Set().has(1); // false
new Proxy(new Set(), {}).has(1); // TypeError: has method called on 
incompatible Proxy
```

```js
// Assuming a web browser
document.nodeType; // 9
new Proxy(document, {}).nodeType; // TypeError: 'get nodeType' called on an 
object that does not implement interface Node.
```

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

Reply via email to