[w3c/ServiceWorker] Consider throwing when non-promise is passed to `waitUntil`. (#1068)

Once switching to async/await, you start writing code like

```js
self.oninstall = event => {
  event.waitUntil(async function() {
    // ...
  }());
}
```

Note that the `async` function is an IIFE, something that is easy to forget and incredibly hard to spot and/or debug, but your code just stops running, effectively failing silently.

I propose that passing anything but a promise to `waitUntil` should throw. This is technically a breaking change, so we should investigate if there’s any _intentional_ usage for non-promises with `waitUntil`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1068

Received on Wednesday, 8 February 2017 13:33:37 UTC