You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, some steps in "initialize a URLPattern" access potentially nonexistent entries in the processedInit map, and expect "compile a component" to receive these as null, even though it requires a string.
Instead, these entries are now always populated after calling "process a URLPatternInit" so that subsequent steps can depend on a valid string.
Since the comparison with the default port requires that the two types be the same, fix that too.
Fixes#209.
Copy file name to clipboardExpand all lines: spec.bs
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -360,7 +360,9 @@ Each {{URLPattern}} object has an associated <dfn for=URLPattern>hash component<
360
360
1. If |baseURL| is not null, then throw a {{TypeError}}.
361
361
1. Set |init| to |input|.
362
362
1. Let |processedInit| be the result of [=process a URLPatternInit=] given |init|, "`pattern`", null, null, null, null, null, null, null, and null.
363
-
1. If |processedInit|["{{URLPatternInit/protocol}}"] is a [=special scheme=] and |processedInit|["{{URLPatternInit/port}}"] is its corresponding [=default port=], then set |processedInit|["{{URLPatternInit/port}}"] to the empty string.
1. If |processedInit|[|componentName|] does not [=map/exist=], then [=map/set=] |processedInit|[|componentName|] to "`*`".
365
+
1. If |processedInit|["{{URLPatternInit/protocol}}"] is a [=special scheme=] and |processedInit|["{{URLPatternInit/port}}"] is a string which represents its corresponding [=default port=] in radix-10 using [=ASCII digits=] then set |processedInit|["{{URLPatternInit/port}}"] to the empty string.
364
366
1. Set |this|'s [=URLPattern/protocol component=] to the result of [=compiling a component=] given |processedInit|["{{URLPatternInit/protocol}}"], [=canonicalize a protocol=], and [=default options=].
365
367
1. Set |this|'s [=URLPattern/username component=] to the result of [=compiling a component=] given |processedInit|["{{URLPatternInit/username}}"], [=canonicalize a username=], and [=default options=].
366
368
1. Set |this|'s [=URLPattern/password component=] to the result of [=compiling a component=] given |processedInit|["{{URLPatternInit/password}}"], [=canonicalize a password=], and [=default options=].
@@ -460,7 +462,6 @@ A [=component=] has an associated <dfn for=component>has regexp groups</dfn>, a
460
462
<div algorithm>
461
463
To <dfn>compile a component</dfn> given a string |input|, [=/encoding callback=] |encoding callback|, and [=/options=] |options|:
462
464
463
-
1. If |input| is null, then set |input| to "`*`".
464
465
1. Let |part list| be the result of running [=parse a pattern string=] given |input|, |options|, and |encoding callback|.
465
466
1. Let (|regular expression string|, |name list|) be the result of running [=generate a regular expression and name list=] given |part list| and |options|.
0 commit comments