Failed to construct classes with 'HTMLElement' as super
Author: duzyCreated Dec 19, 2020Updated Dec 19, 2020
Traceur transpiled code is looking like this:
var e,r=customElements,n=(e=HTMLElement,$traceurRuntime.createClass((function e(){$traceurRuntime.superConstructor(e).call(this),this.style="color: red;"}),{},{},e));From:
class Foo extends HTMLElement {
constructor() { super();
this.style = 'color: red;';
}
};And results:
Uncaught TypeError: Failed to construct 'HTMLElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function.Where this statement fails (the this object is a HTMLElement instance):
$traceurRuntime.superConstructor(e).call(this)Source: google/traceur-compiler