You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Property event in global object Window is non-standard and must be removed from lib.d.ts because of possible errors in browsers that follow the standard (Mozilla Firefox, for example).
It's also an ability for potential wrong behavior in code (example below).
TypeScript Version:
1.7.5 / current Git code.
Code
functionsomeHandler(event: Event,additionalData: number): void{console.log(event,additionalData);}constonClick=(): void=>someHandler(event,1);// <-- forgot the argument `event`element.addEventListener('click',onClick);
Expected behavior:
Error — event is not defined.
Actual behavior:
Silence but code may work incorrectly and didn't work in some browsers.
The text was updated successfully, but these errors were encountered:
Essentially a duplicate of #1351 which deals with a lack of errors with referencing an accidental global versus a locally scoped variable or parameter.
"must be removed" is subjective, as it is non-standard, but it is present in many environments.
Property
event
in global object Window is non-standard and must be removed from lib.d.ts because of possible errors in browsers that follow the standard (Mozilla Firefox, for example).It's also an ability for potential wrong behavior in code (example below).
TypeScript Version:
1.7.5 / current Git code.
Code
Expected behavior:
Error —
event
is not defined.Actual behavior:
Silence but code may work incorrectly and didn't work in some browsers.
The text was updated successfully, but these errors were encountered: