[ServiceWorker] The "uninstalling flag" check in ServiceWorkerRegistration.update() should be moved to the Update algorithm (#807)

Currently the spec in section 3.2.5 step 3 says:

```
If registration's uninstalling flag is set, reject p with an "InvalidStateError" exception and abort these steps.
```

Therefore, if the script calls unregister() and update() sequentially, assuming the job queue is not empty, the Unregister algorithm runs after the initial call to update(), which is where we check the uninstalling flag.

It seems better to move this check to the Update algorithm instead so that we can check the latest value of the uninstalling flag no matter what the order of operations leading to this have been.

I'm modifying Gecko to implement this.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/807

Received on Monday, 4 January 2016 19:57:32 UTC