);
  let elem = w2.document.createElement('my-element');
  let errorEvent = await nextErrorPromise;
  assert_true(elem instanceof w2.HTMLUnknownElement, 'element should be an HTMLUnknownElement');
  if (errorEvent.error) {
    assert_true(errorEvent.error instanceof w.Error, 'error should be an instance created inside the MyElement constructor (if it was not muted)');
  }
  assert_equals(errorEvent.target, w, `error event should target definition's global but instead targets ${event.target === w2 ? 'documen