Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10858,6 +10858,7 @@ interface HTMLElement extends Element, ElementCSSInlineStyle, ElementContentEdit
readonly offsetTop: number;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/offsetWidth) */
readonly offsetWidth: number;
onerror: (event: Event) => void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/outerText) */
outerText: string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/popover) */
Expand Down
1 change: 1 addition & 0 deletions baselines/ts5.5/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10846,6 +10846,7 @@ interface HTMLElement extends Element, ElementCSSInlineStyle, ElementContentEdit
readonly offsetTop: number;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/offsetWidth) */
readonly offsetWidth: number;
onerror: (event: Event) => void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/outerText) */
outerText: string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/popover) */
Expand Down
10 changes: 10 additions & 0 deletions inputfiles/addedTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,16 @@
}
}
}
},
"HTMLElement": {
"properties": {
"property": {
"onerror": {
"name": "onerror",
"overrideType": "(event: Event) => void"
}
}
}
}
}
},
Expand Down
8 changes: 8 additions & 0 deletions unittests/files/onerror.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-var */
// this should not show error
window.onerror = (_message, _source, _lineno, _colno, _error) => {};

// this also should not show error
declare var img: HTMLImageElement;
img.onerror = (_event: Event) => {};
Loading