So, it actually all works as you'd expect when using properties on the
class itself:

```js
```

In that polyfilll, it actually is making x, y, z, and w private fields:
https://github.com/trusktr/geometry-interfaces/blob/41d8cca9c0b4e4ab7afbb9a3a1d02ca94d048f3f/src/DOMPoint.js#L2
```js
const _ = o => {
    if (!privatesMap) {
        privatesMap = new WeakMap
        let privates = {}
        privatesMap.set(o, privates)
        return privates
    }
    else {
        let privates = privatesMap.get(o)

        if (privates === undefined) {
            privates = {}
            privatesMap.set(o, privates)
        }

        return privates
    }
```


So, the new instances _never_ have a visible property for the console to
display. Compare to:

```js
class Test {
    constructor(x) { this._x = x }
    get x(){ return this._x; }
    set x(v){ this._x = v; return v; }
}
console.log(new Test(123));
> Test { x: 123 }
```
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to