TypeScript-DOM-lib-generator icon indicating copy to clipboard operation
TypeScript-DOM-lib-generator copied to clipboard

worker onerror event can be Event or ErrorEvent

Open SimonSiefke opened this issue 2 years ago • 0 comments

interface AbstractWorker {
    /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorker/error_event) */
    onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null;
}

In most cases event is of type ErrorEvent, but for example in Chrome when there is a worker COEP error, the event is of type Event and has no message, lineno or colno properties.

Example: https://chrome-coep-worker-error.glitch.me

Html Spec: https://html.spec.whatwg.org/multipage/indices.html#event-error

Related issue: https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/94

SimonSiefke avatar Jun 17 '23 08:06 SimonSiefke