Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Allow Collator to get collation from option #459

Merged
merged 5 commits into from
Jan 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions spec/collator.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ <h1>InitializeCollator ( _collator_, _locales_, _options_ )</h1>
The abstract operation InitializeCollator accepts the arguments _collator_ (which must be an object), _locales_, and _options_. It initializes _collator_ as a *Collator* object. The following steps are taken:
</p>

<p>
The following algorithm refers to the `type` nonterminal from <a href="https://www.unicode.org/reports/tr35/#Unicode_locale_identifier">UTS 35's Unicode Locale Identifier grammar</a>.
</p>

<emu-alg>
1. Let _requestedLocales_ be ? CanonicalizeLocaleList(_locales_).
1. If _options_ is *undefined*, then
Expand All @@ -29,6 +33,10 @@ <h1>InitializeCollator ( _collator_, _locales_, _options_ )</h1>
1. Let _opt_ be a new Record.
1. Let _matcher_ be ? GetOption(_options_, *"localeMatcher"*, *"string"*, &laquo; *"lookup"*, *"best fit"* &raquo;, *"best fit"*).
1. Set _opt_.[[localeMatcher]] to _matcher_.
1. Let _collation_ be ? GetOption(_options_, *"collation"*, *"string"*, *undefined*, *undefined*).
1. If _collation_ is not *undefined*, then
1. If _collation_ does not match the Unicode Locale Identifier `type` nonterminal, throw a *RangeError* exception.
1. Set _opt_.[[co]] to _collation_.
1. Let _numeric_ be ? GetOption(_options_, *"numeric"*, *"boolean"*, *undefined*, *undefined*).
1. If _numeric_ is not *undefined*, then
1. Let _numeric_ be ! ToString(_numeric_).
Expand Down