Re: [w3c/webcomponents] Non-class based example of customElement.define() (#587)

First, ES6 classes have a ugly static limitations (permanently engrained `super` references), and now we can't use ES5 classes in custom elements? What if we generate those classes from a class library? This is not ideal. The following should NOT give an error:

```js
function BarBar() { console.log('hello') }
BarBar.prototype = Object.create(HTMLElement.prototype)
customElements.define('bar-bar', BarBar)
document.createElement('bar-bar')
```

Output:

```
hello
Uncaught TypeError: Failed to execute 'createElement' on 'Document': The result must implement HTMLElement interface
```

Honestly, why?

-- 
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/587#issuecomment-269100188

Received on Saturday, 24 December 2016 20:59:27 UTC