Re: [w3c/ServiceWorker] unclear how Client.postMessage looks up its destination (#1042)

I did read that definition, it makes for an explicit `ServiceWorkerContainer` -> service worker client mapping, and while it describes a way to do the inverse mapping as part of the definition, that inverse isn't actually given its own definition for use elsewhere. Whereas something like [the 1-to-1-to-1 relation for Realm/global/settings object](https://html.spec.whatwg.org/multipage/webappapis.html#realms-settings-objects-global-objects) defines all six mappings between the associated objects explicitly. As is, it's like saying "let *x* be the JavaScript realm whose [[GlobalObject]] field is *window*" instead of the more straightforward "*window*'s Realm".

The null-check still makes no sense, because it didn't say e.g. "let destination be the [[SWContainer]] internal slot of the service worker client", which could be either a `ServiceWorkerContainer` or null, with a step elsewhere in the spec that sets it to null when the client closes. It uses much more convoluted and indirect wording, and you have to infer that it's supposed to set *destination* to null if the wording as-is, taken literally, is effectively impossible, because there is no Container that fits that description anymore.

-- 
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/1042#issuecomment-270043959

Received on Tuesday, 3 January 2017 02:39:18 UTC