You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor onerror and similar properties for windows and workers (#102)
`onerror`, `onunhandledrejection`, `onrejectionhandled` and `self` are
all properties in the global scope that live in both `Window` and
`WorkerGlobalScope`. However, unlike other properties that apply to
both windows and workers, these properties are defined separately for
windows and for workers.
The current spec text deals with them by listing the property name and
linking in parenthesis to both definitions in the HTML spec. However,
in this edition of the Minimum Common API specification, we don't talk
a lot about workers, and we don't require runtimes to implement them.
This patch clarifies this by linking to the `Window` definitions in
the main list of properties, and adding a paragraph after that that
links to the `WorkerGlobalScope` defintions and specifies that
runtimes with workers should also support them.
Additionally, we remove an issue about exposing `self` on the
`ShadowRealmGlobalScope` in the future when whatwg/html#9893 lands,
since the ShadowRealm proposal seems to have lost a lot of steam
lately. We can always add a similar paragraph to the workers one if it
ever picks up pace again.
* `globalThis.onerror` (on {{GlobalEventHandlers/onerror|Window}} and {{WorkerGlobalScope/onerror|WorkerGlobalScope}})[[!HTML]]
111
-
* `globalThis.onunhandledrejection` (on {{WindowEventHandlers/onunhandledrejection|Window}} and {{WorkerGlobalScope/onunhandledrejection|WorkerGlobalScope}})[[!HTML]]
112
-
* `globalThis.onrejectionhandled` (on {{WindowEventHandlers/onrejectionhandled|Window}} and {{WorkerGlobalScope/onrejectionhandled|WorkerGlobalScope}})[[!HTML]]
0 commit comments