Description
TypeScript Version: 2.0.3
Code
tsconfig.json includes lib es6
:
{
"compilerOptions": {
"lib": [
"es6",
"dom"
]
},
}
function eventHandler() {
// typescript doesn't complain about missing event variable, because event is declared as global in lib.es6.d.ts
console.log(event.target);
}
Expected behavior:
Don't expect event to exist on the global object. Couldn't reproduce it in Safari, Firefox or Chrome. It's always console.log(window.event); // undefined
Actual behavior:
event: Event
is declared as global variable in lib.es6.d.ts
https://github.com/Microsoft/TypeScript/blob/2e7c83abc833534181d97c534bfac865cd93b1f0/lib/lib.es6.d.ts#L18680
https://github.com/Microsoft/TypeScript/blob/2e7c83abc833534181d97c534bfac865cd93b1f0/lib/lib.es6.d.ts#L20129