From 39c50be91321815137c65a82eafb26e39546c6d3 Mon Sep 17 00:00:00 2001 From: Matt Reynolds Date: Tue, 10 Oct 2023 15:39:51 -0700 Subject: [PATCH] Replace ECMAscript String with infra string algorithms --- index.bs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/index.bs b/index.bs index b68e004..f402248 100644 --- a/index.bs +++ b/index.bs @@ -2320,19 +2320,17 @@ The result of parsing the blocklist at a {{URL}} |url| is a [=list=] of {{USBBlocklistEntry}} objects produced by the following algorithm: 1. Fetch |url| and let |contents| be its body, decoded as UTF-8. - 1. Let |lines| be the result of invoking - {{String/split(separator, limit)}} on |contents| with separator - '\n'. + 1. Let |lines| be the result of [=strictly splitting=] |contents| starting + from the beginning of |contents| on code point '\n'. 1. Let |blocklist| be an empty [=list=]. 1. [=list/For each=] |line| of |lines|: - 1. Let |commentBegin| be the result of invoking - |line|.{{String/indexOf()}} with '#'. - 1. If |commentBegin| is not -1, set |line| to the result of invoking - |line|.{{String/substring()}} with 0 and |commentBegin|. - 1. Set |line| to the result of |line|.{{String/trimEnd()}}. - 1. Let |components| be the result of invoking - |line|.{{String/split(separator, limit)}} with separator - ':'. + 1. Set |line| to the result of [=collecting a sequence of code points=] + not equal to '#' from |line| starting from the beginning + of |line|. + 1. Set |line| to the result of [=stripping leading and trailing ASCII + whitespace=] from |line|. + 1. Let |components| be the result of [=strictly splitting=] |line| + starting from the beginning of |line| on code point ':'. 1. If the [=list/size=] of |components| is not 2 or 3, [=iteration/continue=]. 1. Let |idVendor| be the result of invoking