From 5ce2f70b8eeb1b8808476ffc8c45c0f9734a7efc Mon Sep 17 00:00:00 2001 From: Jeremy Roman Date: Tue, 30 Jan 2024 10:22:29 -0500 Subject: [PATCH] Do not initialize members to null in "process a URLPatternInit" It is not valid for these dictionary members to be null, since they are defined to, if present, hold a USVString value. Instead, these should be omitted from the result dictionary altogether if no string was provided to this algorithm. This addresses the concern raised in #202 (comment). --- spec.bs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec.bs b/spec.bs index a6d24a5..cec6cbe 100644 --- a/spec.bs +++ b/spec.bs @@ -1802,14 +1802,14 @@ To convert a modifier to a string given a [=part/modifier=] |modifier To process a URLPatternInit given a {{URLPatternInit}} |init|, a string |type|, a string or null |protocol|, a string or null |username|, a string or null |password|, a string or null |hostname|, a string or null |port|, a string or null |pathname|, a string or null |search|, and a string or null |hash|: 1. Let |result| be the result of creating a new {{URLPatternInit}}. - 1. Set |result|["{{URLPatternInit/protocol}}"] to |protocol|. - 1. Set |result|["{{URLPatternInit/username}}"] to |username|. - 1. Set |result|["{{URLPatternInit/password}}"] to |password|. - 1. Set |result|["{{URLPatternInit/hostname}}"] to |hostname|. - 1. Set |result|["{{URLPatternInit/port}}"] to |port|. - 1. Set |result|["{{URLPatternInit/pathname}}"] to |pathname|. - 1. Set |result|["{{URLPatternInit/search}}"] to |search|. - 1. Set |result|["{{URLPatternInit/hash}}"] to |hash|. + 1. If |protocol| is not null, [=map/set=] |result|["{{URLPatternInit/protocol}}"] to |protocol|. + 1. If |username| is not null, [=map/set=] |result|["{{URLPatternInit/username}}"] to |username|. + 1. If |password| is not null, [=map/set=] |result|["{{URLPatternInit/password}}"] to |password|. + 1. If |hostname| is not null, [=map/set=] |result|["{{URLPatternInit/hostname}}"] to |hostname|. + 1. If |port| is not null, [=map/set=] |result|["{{URLPatternInit/port}}"] to |port|. + 1. If |pathname| is not null, [=map/set=] |result|["{{URLPatternInit/pathname}}"] to |pathname|. + 1. If |search| is not null, [=map/set=] |result|["{{URLPatternInit/search}}"] to |search|. + 1. If |hash| is not null, [=map/set=] |result|["{{URLPatternInit/hash}}"] to |hash|. 1. Let |baseURL| be null. 1. If |init|["{{URLPatternInit/baseURL}}"] [=map/exists=]: