-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScript
Milestone
Description
Easiest explained via the repro steps:
$ cd `mktemp -d`
$ npm init --force
$ npm install --save-dev typescript@2.2.0-dev.20161122
$ grep -r 'onload:' node_modules/typescript/lib/
node_modules/typescript/lib/lib.es6.d.ts: onload: (this: this, ev: Event) => any;
node_modules/typescript/lib/lib.es6.d.ts: onload: (this: this, ev: Event) => any;
node_modules/typescript/lib/lib.es6.d.ts: onload: (this: this, ev: Event) => any;
node_modules/typescript/lib/lib.es6.d.ts: onload: (this: this, ev: Event) => any;
node_modules/typescript/lib/lib.es6.d.ts: onload: (this: this, ev: Event) => any;
....But then
$ npm install --save-dev typescript@2.2.0-dev.20161124
$ grep -r 'onload:' node_modules/typescript/lib/
node_modules/typescript/lib/lib.es6.d.ts: onload: (this: Document, ev: Event) => any;
node_modules/typescript/lib/lib.es6.d.ts: onload: (this: HTMLBodyElement, ev: Event) => any;
node_modules/typescript/lib/lib.es6.d.ts: onload: (this: HTMLElement, ev: Event) => any;
node_modules/typescript/lib/lib.es6.d.ts: onload: (this: HTMLFrameElement, ev: Event) => any;
node_modules/typescript/lib/lib.es6.d.ts: onload: (this: HTMLFrameSetElement, ev: Event) => any;
node_modules/typescript/lib/lib.es6.d.ts: onload: (this: HTMLIFrameElement, ev: Event) => any;
...This has the obvious impact:
let image = new Image();
// with typescript@2.2.0-dev.20161122
image.onload // has type HTMLElement.onload: (this: HTMLImageElement, ev: Event) => any
// with typescript@2.2.0-dev.20161124
image.onload // has type HTMLElement.onload: (this: HTMLElement, ev: Event) => anyIs this an intentional change?
aluanhaddad, svieira, falsandtru, oocx and mieszczans
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScript