diff options
Diffstat (limited to 'js/src/tests/test262/intl402/Locale')
-rw-r--r-- | js/src/tests/test262/intl402/Locale/constructor-options-collation-invalid.js | 2 | ||||
-rw-r--r-- | js/src/tests/test262/intl402/Locale/prototype/calendar/canonicalize.js | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/js/src/tests/test262/intl402/Locale/constructor-options-collation-invalid.js b/js/src/tests/test262/intl402/Locale/constructor-options-collation-invalid.js index d256093257..10f5cd5e4a 100644 --- a/js/src/tests/test262/intl402/Locale/constructor-options-collation-invalid.js +++ b/js/src/tests/test262/intl402/Locale/constructor-options-collation-invalid.js @@ -30,7 +30,7 @@ const invalidCollationOptions = [ for (const invalidCollationOption of invalidCollationOptions) { assert.throws(RangeError, function() { new Intl.Locale("en", {collation: invalidCollationOption}); - }, '`new Intl.Locale("en", {collation: invalidCollationOption})` throws RangeError'); + }); } reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Locale/prototype/calendar/canonicalize.js b/js/src/tests/test262/intl402/Locale/prototype/calendar/canonicalize.js new file mode 100644 index 0000000000..5ade4fe795 --- /dev/null +++ b/js/src/tests/test262/intl402/Locale/prototype/calendar/canonicalize.js @@ -0,0 +1,22 @@ +// Copyright 2024 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-apply-unicode-extension-to-tag +description: Checks canonicalize value of extension in ApplyUnicodeExtensionToTag. +info: | + ApplyUnicodeExtensionToTag + 1. Let _optionsUValue_ be the ASCII-lowercase of _optionsValue_. + 1. Set _value_ to the String value resulting from canonicalizing _optionsUValue_ as a value of key _key_ per <a href="https://unicode.org/reports/tr35/#processing-localeids">Unicode Technical Standard #35 Part 1 Core, Annex C LocaleId Canonicalization Section 5 Canonicalizing Syntax, Processing LocaleIds</a>. +features: [Intl.Locale] +---*/ + +const loc = new Intl.Locale('en', {calendar: 'islamicc'}); + +assert.sameValue(loc.toString(), "en-u-ca-islamic-civil", + "'islamicc' should be canonicalize to 'islamic-civil'"); + +assert.sameValue(loc.calendar, "islamic-civil", + "'islamicc' should be canonicalize to 'islamic-civil'"); + +reportCompare(0, 0); |