[ServiceWorker] Use of Upon fulfillment/rejection in CacheStorage.match is incorrect (#627)

https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache-storage-match-method has:

> 1. Return the result of transforming ... with a fulfillment handler that ...:
>   1. For each key in keys:
>     1. Let q be [a promise returned by ...]
>     1. Upon fulfillment of q with value matchedResponse:
>       1. If matchedResponse is not undefined, return matchedResponse.
>     1. Upon rejection of q with value err:
>       1. Throw err.
>   1. Return undefined.

Upon Fulfillment/Rejection handlers call `q.then`, but they don't do anything with the returned promise, so the values returned and thrown in those handlers don't wind up getting used. This Else branch is always going to fulfill with `undefined`, which probably wasn't intended.

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

Received on Tuesday, 17 February 2015 23:17:56 UTC