[w3c/webcomponents] Returning a Proxy from a Custom Element constructor (#857)

Unfortunately, the following causes an error:

```js
class A extends HTMLElement {
  constructor() {
    super()
    return new Proxy(this, {
      get(target, key) {
        console.log('get property:' key)
        return target[key]
      }
    })
  }
}

window.customElements.define('a-element', A)
```

```html
<a-element></a-element>
```

```
Uncaught DOMException: custom element constructors must call super() first and must not return a different object
```

Can Custom Elements API be upgraded to support Proxied instances?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/857

Received on Saturday, 30 November 2019 04:58:36 UTC