Re: [ServiceWorker] Consider producing distinct objects for the same entity to enable garbage collection (#416)

Oh I didn't catch the following implementation issues:
https://code.google.com/p/chromium/issues/detail?id=523904
https://bugzilla.mozilla.org/show_bug.cgi?id=1181039

So I think the following behavior seems right (the same object and the distinct object is for the promise resolution value):
```js
navigator.serviceWorker.register().then(registration => {}); // same object
navigator.serviceWorker.getRegistration().then(registration => {}); // same object
navigator.serviceWorker.getRegistrations().then(registrations => {}); // same object
clients.matchAll().then(clients => {}); // same object
clients.openWindow().then(windowClient => {}); // distinct object
WindowClient.focus().then(windowClient => {}); // distinct object
(Extendable/ServiceWorker)MessageEvent.source; // same object
(Extendable/ServiceWorker)MessageEvent.ports; // same object

CacheStorage.match().then(response => {}); // distinct object
CacheStorage.open().then(cache => {}); // distinct object
Cache.match().then(response => {}); // distinct object
Cache.matchAll().then(responses => {}); // distinct object
Cache.keys().then(requests => {}); // distinct object
```

In the spec, when a distinct object is required, I used "new" explicitly. For the same objects, I did it with "an object that represents the target object." It seems better wording is necessary here to make it clearer? (any suggestion?)

/cc @nhiroki @mattto @wanderview @nikhilm @slightlyoff @jakearchibald @annevk 

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

Received on Tuesday, 1 September 2015 06:33:50 UTC