Skip to content

Commit 8bb9587

Browse files
committed
nullable handlers
1 parent 5f49abf commit 8bb9587

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

baselines/dom.generated.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5132,7 +5132,7 @@ interface GlobalEventHandlers {
51325132
ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
51335133
onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
51345134
onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
5135-
onerror: (this: GlobalEventHandlers, ev: ErrorEvent) => any;
5135+
onerror: ((this: GlobalEventHandlers, ev: ErrorEvent) => any) | null;
51365136
onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
51375137
ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
51385138
oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
@@ -15891,7 +15891,7 @@ interface WindowEventHandlersEventMap {
1589115891
interface WindowEventHandlers {
1589215892
onafterprint: ((this: WindowEventHandlers, ev: Event) => any) | null;
1589315893
onbeforeprint: ((this: WindowEventHandlers, ev: Event) => any) | null;
15894-
onbeforeunload: (this: WindowEventHandlers, ev: BeforeUnloadEvent) => any;
15894+
onbeforeunload: ((this: WindowEventHandlers, ev: BeforeUnloadEvent) => any) | null;
1589515895
onhashchange: ((this: WindowEventHandlers, ev: HashChangeEvent) => any) | null;
1589615896
onlanguagechange: ((this: WindowEventHandlers, ev: Event) => any) | null;
1589715897
onmessage: ((this: WindowEventHandlers, ev: MessageEvent) => any) | null;
@@ -16746,7 +16746,7 @@ declare var ondrop: ((this: Window, ev: DragEvent) => any) | null;
1674616746
declare var ondurationchange: ((this: Window, ev: Event) => any) | null;
1674716747
declare var onemptied: ((this: Window, ev: Event) => any) | null;
1674816748
declare var onended: ((this: Window, ev: Event) => any) | null;
16749-
declare var onerror: (this: Window, ev: ErrorEvent) => any;
16749+
declare var onerror: ((this: Window, ev: ErrorEvent) => any) | null;
1675016750
declare var onfocus: ((this: Window, ev: FocusEvent) => any) | null;
1675116751
declare var ongotpointercapture: ((this: Window, ev: PointerEvent) => any) | null;
1675216752
declare var oninput: ((this: Window, ev: Event) => any) | null;

src/emitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ export function emitWebIDl(webidl: Browser.WebIdl, flavor: Flavor) {
556556
// normally, but in "SVGSVGElement" it handles "SVGError" event instead.
557557
const eType = p["event-handler"] ? getEventTypeInInterface(p["event-handler"]!, i) : "Event";
558558
pType = `(${emitEventHandlerThis(prefix, i)}ev: ${eType}) => any`;
559-
if (p.type === "EventHandler") {
559+
if (typeof p.type === "string" && !p.type.endsWith("NonNull")) {
560560
pType = `(${pType}) | null`;
561561
}
562562
}

0 commit comments

Comments
 (0)