Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to construct classes with 'HTMLElement' as super #2148

Open
duzy opened this issue Dec 19, 2020 · 0 comments
Open

Failed to construct classes with 'HTMLElement' as super #2148

duzy opened this issue Dec 19, 2020 · 0 comments

Comments

@duzy
Copy link

duzy commented 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant