Compiler doesn't recognize named functions
description
This is a very common piece of code in JavaScript that does not compile in tsc:
window.addEventListener('load', function winLoad() {
window.removeEventListener('load', winLoad);
});
Compiler complains:
The name 'winLoad' does not exist in the current scope
This is valid JavaScript.