lements.define('a-a', class extends HTMLElement {
  constructor() {
    super();
    return []; // returning objects other than "this" is invalid.
  }
});
  </script>
</template>
<script>
const constructor_returns_bad_object =
  document.getElementById('constructor-returns-bad-object').innerHTML;

function assert_type_error_event(error) {
  assert_not_muted_error_event(error);
  assert_equals(error.error.name, 'TypeError');
}

function assert_invalid_state_dom_error_event(error) {
  assert_not_muted_error_e