webworker: waitUntil should require a Promise #48553
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Help Wanted
You can do this
Milestone
webworker lib Update Request
Missing / Incorrect Definition
Today,
ExtendableEvent
'swaitUntil
acceptsany
. 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
I would argue this needs to be typed as
Promise<any>
rather thanany
. This will catch two mistakes:waitUntil(longTask());
, withlongTask
a non-async function).Documentation Link
https://developer.mozilla.org/en-US/docs/Web/API/ExtendableEvent/waitUntil
The text was updated successfully, but these errors were encountered: