Skip to content

Commit

Permalink
Allow Collator to get collation from option
Browse files Browse the repository at this point in the history
Collator already have "co" in  [[RelevantExtensionKeys]] internal slot and therefore the  usage by using "-u-co-$collationkey" is already supported in ECMA402.

Close #380
  • Loading branch information
FrankYFTang authored Jun 16, 2020
1 parent 54a0cd6 commit e78413e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/collator.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ <h1>InitializeCollator ( _collator_, _locales_, _options_ )</h1>
1. Set _opt_.[[kn]] to _numeric_.
1. Let _caseFirst_ be ? GetOption(_options_, *"caseFirst"*, *"string"*, &laquo; *"upper"*, *"lower"*, *"false"* &raquo;, *undefined*).
1. Set _opt_.[[kf]] to _caseFirst_.
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 _relevantExtensionKeys_ be %Collator%.[[RelevantExtensionKeys]].
1. Let _r_ be ResolveLocale(%Collator%.[[AvailableLocales]], _requestedLocales_, _opt_, _relevantExtensionKeys_, _localeData_).
1. Set _collator_.[[Locale]] to _r_.[[locale]].
Expand Down

0 comments on commit e78413e

Please sign in to comment.