Skip to content

Commit 29525e0

Browse files
committed
Use RangeError instead of TypeError for language tag validation
Closes #62.
1 parent 73def37 commit 29525e0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

index.bs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ enum SummarizerLength { "short", "medium", "long" };
122122
</div>
123123

124124
<div algorithm>
125-
To <dfn>validate and canonicalize summarizer options</dfn> given a {{SummarizerCreateCoreOptions}} |options|, perform the following steps. They mutate |options| in place to canonicalize and deduplicate language tags, and throw a {{TypeError}} if any are invalid.
125+
To <dfn>validate and canonicalize summarizer options</dfn> given a {{SummarizerCreateCoreOptions}} |options|, perform the following steps. They mutate |options| in place to canonicalize and deduplicate language tags, and throw an exception if any are invalid.
126126

127127
1. [=Validate and canonicalize language tags=] given |options| and "{{SummarizerCreateCoreOptions/expectedInputLanguages}}".
128128

@@ -700,7 +700,7 @@ enum WriterLength { "short", "medium", "long" };
700700
</div>
701701

702702
<div algorithm>
703-
To <dfn>validate and canonicalize writer options</dfn> given a {{WriterCreateCoreOptions}} |options|, perform the following steps. They mutate |options| in place to canonicalize and deduplicate language tags, and throw a {{TypeError}} if any are invalid.
703+
To <dfn>validate and canonicalize writer options</dfn> given a {{WriterCreateCoreOptions}} |options|, perform the following steps. They mutate |options| in place to canonicalize and deduplicate language tags, and throw an exception if any are invalid.
704704

705705
1. [=Validate and canonicalize language tags=] given |options| and "{{WriterCreateCoreOptions/expectedInputLanguages}}".
706706

@@ -1209,7 +1209,7 @@ enum RewriterLength { "as-is", "shorter", "longer" };
12091209
</div>
12101210

12111211
<div algorithm>
1212-
To <dfn>validate and canonicalize rewriter options</dfn> given a {{RewriterCreateCoreOptions}} |options|, perform the following steps. They mutate |options| in place to canonicalize and deduplicate language tags, and throw a {{TypeError}} if any are invalid.
1212+
To <dfn>validate and canonicalize rewriter options</dfn> given a {{RewriterCreateCoreOptions}} |options|, perform the following steps. They mutate |options| in place to canonicalize and deduplicate language tags, and throw an exception if any are invalid.
12131213

12141214
1. [=Validate and canonicalize language tags=] given |options| and "{{RewriterCreateCoreOptions/expectedInputLanguages}}".
12151215

@@ -2200,7 +2200,7 @@ Every [=interface=] [=interface/including=] the {{DestroyableModel}} interface m
22002200
<h3 id="supporting-language-tags">Language tags</h3>
22012201

22022202
<div algorithm>
2203-
To <dfn export>validate and canonicalize language tags</dfn> given a [=ordered map=] |options| and a [=string=] |key|, perform the following steps. They mutate |options| in place to canonicalize and deduplicate language tags found in |options|[|key|], and throw a {{TypeError}} if any are invalid.
2203+
To <dfn export>validate and canonicalize language tags</dfn> given a [=ordered map=] |options| and a [=string=] |key|, perform the following steps. They mutate |options| in place to canonicalize and deduplicate language tags found in |options|[|key|], and throw an exception if any are invalid.
22042204

22052205
1. [=Assert=]: |options|[|key|] [=map/exists=].
22062206

@@ -2222,7 +2222,7 @@ Every [=interface=] [=interface/including=] the {{DestroyableModel}} interface m
22222222
<div algorithm>
22232223
To <dfn lt="validate and canonicalize a single language tag|validating and canonicalizing a single language tag">validate and canonicalize a single language tag</dfn> given a [=string=] |potentialLanguageTag|:
22242224

2225-
1. If [$IsStructurallyValidLanguageTag$](|potentialLanguageTag|) is false, then throw a {{TypeError}}.
2225+
1. If [$IsStructurallyValidLanguageTag$](|potentialLanguageTag|) is false, then throw a {{RangeError}}.
22262226

22272227
1. Return [$CanonicalizeUnicodeLocaleId$](|potentialLanguageTag|).
22282228
</div>

0 commit comments

Comments
 (0)