-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
microsoft/TypeScript-DOM-lib-generator
#1326Labels
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 TypeScriptHelp WantedYou can do thisYou can do this
Milestone
Description
webworker lib Update Request
Missing / Incorrect Definition
Today, ExtendableEvent's waitUntil accepts any. A common mistake is to pass it a function, expecting the engine to call it. It doesn't, and will silently fail.
This is defined here:
TypeScript/lib/lib.webworker.d.ts
Line 1542 in cec2fda
| waitUntil(f: any): void; |
I would argue this needs to be typed as Promise<any> rather than any. This will catch two mistakes:
- Passing a function, expecting it will be called
- Passing a value, expecting it won't be called right away (eg:
waitUntil(longTask());, withlongTaska non-async function).
Documentation Link
https://developer.mozilla.org/en-US/docs/Web/API/ExtendableEvent/waitUntil
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 TypeScriptHelp WantedYou can do thisYou can do this