Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
Bug 1670062: Support "collation" option in Intl.Collator constructor.…
Browse files Browse the repository at this point in the history
… r=yulia

Implements the changes from the "has consensus" PR <tc39/ecma402#459>.

Drive-by change:
- Enable a named groups RegExp test which wasn't enabled when bug 1362154 was implemented.

Differential Revision: https://phabricator.services.mozilla.com/D95734
  • Loading branch information
anba committed Nov 24, 2020
1 parent c49cdd4 commit 6d3c6e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 7 additions & 0 deletions js/src/builtin/intl/Collator.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function InitializeCollator(collator, locales, options) {
// opt: // opt object computed in InitializeCollator
// {
// localeMatcher: "lookup" / "best fit",
// co: string matching a Unicode extension type / undefined
// kn: true / false / undefined,
// kf: "upper" / "lower" / "false" / undefined
// }
Expand Down Expand Up @@ -158,6 +159,12 @@ function InitializeCollator(collator, locales, options) {
var matcher = GetOption(options, "localeMatcher", "string", ["lookup", "best fit"], "best fit");
opt.localeMatcher = matcher;

// https://github.com/tc39/ecma402/pull/459
var collation = GetOption(options, "collation", "string", undefined, undefined);
if (collation !== undefined)
collation = intl_ValidateAndCanonicalizeUnicodeExtensionType(collation, "collation", "co");
opt.co = collation;

// Steps 11-13.
var numericValue = GetOption(options, "numeric", "boolean", undefined, undefined);
if (numericValue !== undefined)
Expand Down
6 changes: 0 additions & 6 deletions js/src/tests/jstests.list
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,6 @@ skip script test262/built-ins/Function/prototype/toString/built-in-function-obje
# https://bugzilla.mozilla.org/show_bug.cgi?id=1225839
ignore-flag(--more-compartments) script test262/built-ins/Function/internals/Call/class-ctor-realm.js

# https://bugzilla.mozilla.org/show_bug.cgi?id=1670062
skip script test262/intl402/Collator/constructor-options-throwing-getters.js

# These two tests assume that assignment to function calls is a SyntaxError. We
# historically implemented otherwise, as web reality. Perhaps that can be
# reevaluated at some point.
Expand Down Expand Up @@ -440,9 +437,6 @@ ignore-flag(--more-compartments) script test262/built-ins/Proxy/construct/return
ignore-flag(--more-compartments) script test262/built-ins/Proxy/construct/return-not-object-throws-boolean-realm.js
ignore-flag(--more-compartments) script test262/built-ins/Proxy/construct/return-not-object-throws-boolean-realm.js

# https://bugzilla.mozilla.org/show_bug.cgi?id=1362154
skip script test262/built-ins/String/prototype/replaceAll/searchValue-replacer-RegExp-call.js

# Depends upon the SharedArrayBuffer constructor being defined as a global
# property -- and right now, it's only defined for cross-site-isolated pages
# that request it using COOP/COEP.
Expand Down

0 comments on commit 6d3c6e4

Please sign in to comment.