Skip to content

Commit d3082ca

Browse files
Update docs/index.bs
- remvoed unnecessary type check. I added that for allowing the argument to be Promsie, which I reverted. - move fetch-event check inside the loop to make the code a bit simpler.
1 parent 7cd9483 commit d3082ca

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

docs/index.bs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1607,12 +1607,11 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
16071607

16081608
1. Let |event| be [=this=].
16091609
1. If |event|'s [=dispatch flag=] is unset, [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
1610-
1. If |rules| is not either of a {{RouterRule}} dictionary or a sequence of {{RouterRule}} dictionaries, then return [=a promise rejected with=] a {{TypeError}}.
16111610
1. If |rules| is a {{RouterRule}} dictionary, set |rules| to « |rules| ».
16121611
1. Let |serviceWorker| be the [=current global object=]'s associated [=ServiceWorkerGlobalScope/service worker=].
16131612
1. For each |rule| of |rules|:
16141613
1. If running the [=Verify Router Condition=] algorithm with |rule|["{{RouterRule/condition}}"] and |serviceWorker| returns false, return [=a promise rejected with=] a {{TypeError}}.
1615-
1. If |rules| [=list/contains=] a {{RouterRule}} whose {{RouterRule/source}} is "{{RouterSourceEnum/fetch-event}}" and |serviceWorker|'s [=set of event types to handle=] does not [=set/contain=] {{ServiceWorkerGlobalScope/fetch!!event}}, return [=a promise rejected with=] a {{TypeError}}.
1614+
1. If |rule|["{{RouterRule/source}}"] is "{{RouterSourceEnum/fetch-event}}" and |serviceWorker|'s [=set of event types to handle=] does not [=set/contain=] {{ServiceWorkerGlobalScope/fetch!!event}}, return [=a promise rejected with=] a {{TypeError}}.
16161615
1. Let |promise| be a new [=promise=].
16171616
1. [=ExtendableEvent/Add lifetime promise=] |promise| to |event|.
16181617

0 commit comments

Comments
 (0)