Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

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

Description

@duzy

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions