w3c / ServiceWorker

Service Workers
https://w3c.github.io/ServiceWorker/
Other
3.63k stars 315 forks source link

reflect internal "parsed" state in ServiceWorkerState enum #1162

Open wanderview opened 7 years ago

wanderview commented 7 years ago

Currently the spec defines an internal ServiceWorker state parsed:

https://w3c.github.io/ServiceWorker/#dfn-state

The webidl ServiceWorkerState enum, however, does not define a matching value. The spec does not say what to do if the .state getter is somehow called while the state is parsed.

We could explicitly throw, but I think it would be better to just reflect the state in the enum.

wanderview commented 6 years ago

FWIW I'm landing this change in gecko's webidl for now. I need some value internally for the state during initial script evaluation before installation actually starts. Currently its not accessible to script but of course that could change with stuff like #1077. If anyone would like to use a different name, e.g. evaluating, please let me know.

jakearchibald commented 6 years ago

Given it isn't exposed to script right now, is there anything stopping us changing the name if we did decide to expose it?

wanderview commented 6 years ago

Right, we can change the name if desired.