diff --git a/test/intl402/Locale/constructor-options-firstDayOfWeek-invalid.js b/test/intl402/Locale/constructor-options-firstDayOfWeek-invalid.js index a2a754d923..727134d7f9 100644 --- a/test/intl402/Locale/constructor-options-firstDayOfWeek-invalid.js +++ b/test/intl402/Locale/constructor-options-firstDayOfWeek-invalid.js @@ -9,7 +9,10 @@ info: | Intl.Locale( tag [, options] ) ... - x. Let numberingSystem be ? GetOption(options, "firstDayOfWeek", "string", < *"mon"*, *"tue"*, *"wed"*, *"thu"*, *"fri"*, *"sat"*, *"sun"*, *"0"*, *"1"*, *"2"*, *"3"*, *"4"*, *"5"*, *"6"*, *"7"*> , undefined). + x. Let fw be ? GetOption(options, "firstDayOfWeek", "string", undefined, undefined). + x. If fw is not undefined, then + x. Set fw to !WeekdayToString(fw). + x. If fw does not match the type sequence (from UTS 35 Unicode Locale Identifier, section 3.2), throw a RangeError exception. ... features: [Intl.Locale,Intl.Locale-info] @@ -19,10 +22,7 @@ const invalidFirstDayOfWeekOptions = [ "", "m", "mo", - "monday", - true, - false, - null, + "longerThan8Chars", ]; for (const firstDayOfWeek of invalidFirstDayOfWeekOptions) { assert.throws(RangeError, function() { diff --git a/test/intl402/Locale/constructor-options-firstDayOfWeek-valid.js b/test/intl402/Locale/constructor-options-firstDayOfWeek-valid.js index d9efe8bf82..4905bfc0c8 100644 --- a/test/intl402/Locale/constructor-options-firstDayOfWeek-valid.js +++ b/test/intl402/Locale/constructor-options-firstDayOfWeek-valid.js @@ -9,18 +9,15 @@ info: | Intl.Locale( tag [, options] ) ... - x. Let numberingSystem be ? GetOption(options, "firstDayOfWeek", "string", < *"mon"*, *"tue"*, *"wed"*, *"thu"*, *"fri"*, *"sat"*, *"sun"*, *"0"*, *"1"*, *"2"*, *"3"*, *"4"*, *"5"*, *"6"*, *"7"*> , undefined). - x. Let firstDay be *undefined*. - x. If fw is not *undefined*, then - x. Set firstDay to !WeekdayToString(fw). - x. Set opt.[[fw]] to firstDay. + x. Let fw be ? GetOption(options, "firstDayOfWeek", "string", undefined, undefined). + x. If fw is not undefined, then + x. Set fw to !WeekdayToString(fw). + x. If fw does not match the type sequence (from UTS 35 Unicode Locale Identifier, section 3.2), throw a RangeError exception. + x. Set opt.[[fw]] to fw. ... x. Let r be ! ApplyUnicodeExtensionToTag(tag, opt, relevantExtensionKeys). ... - x. Let firstDay be *undefined*. - x. If r.[[fw]] is not *undefined*, then - x. Set firstDay to ! WeekdayToNumber(r.[[fw]]). - x. Set locale.[[FirstDayOfWeek]] to firstDay. + x. Set locale.[[FirstDayOfWeek]] to r.[[fw]]. ... features: [Intl.Locale,Intl.Locale-info] @@ -50,6 +47,24 @@ const validFirstDayOfWeekOptions = [ [6, "en-u-fw-sat"], [7, "en-u-fw-sun"], [0, "en-u-fw-sun"], + [true, "en-u-fw-true"], + [false, "en-u-fw-false"], + [null, "en-u-fw-null"], + ["primidi", "en-u-fw-primidi"], + ["duodi", "en-u-fw-duodi"], + ["tridi", "en-u-fw-tridi"], + ["quartidi", "en-u-fw-quartidi"], + ["quintidi", "en-u-fw-quintidi"], + ["sextidi", "en-u-fw-sextidi"], + ["septidi", "en-u-fw-septidi"], + ["octidi", "en-u-fw-octidi"], + ["nonidi", "en-u-fw-nonidi"], + ["decadi", "en-u-fw-decadi"], + ["frank", "en-u-fw-frank"], + ["yungfong", "en-u-fw-yungfong"], + ["yung-fong", "en-u-fw-yung-fong"], + ["tang", "en-u-fw-tang"], + ["frank-yung-fong-tang", "en-u-fw-frank-yung-fong-tang"], ]; for (const [firstDayOfWeek, expected] of validFirstDayOfWeekOptions) { assert.sameValue( diff --git a/test/intl402/Locale/prototype/firstDayOfWeek/valid-id.js b/test/intl402/Locale/prototype/firstDayOfWeek/valid-id.js index 12acd526a9..d9aa88a33b 100644 --- a/test/intl402/Locale/prototype/firstDayOfWeek/valid-id.js +++ b/test/intl402/Locale/prototype/firstDayOfWeek/valid-id.js @@ -13,13 +13,13 @@ features: [Intl.Locale,Intl.Locale-info] ---*/ const validIds = [ - ["en-u-fw-mon", 1], - ["en-u-fw-tue", 2], - ["en-u-fw-wed", 3], - ["en-u-fw-thu", 4], - ["en-u-fw-fri", 5], - ["en-u-fw-sat", 6], - ["en-u-fw-sun", 7], + ["en-u-fw-mon", "mon"], + ["en-u-fw-tue", "tue"], + ["en-u-fw-wed", "wed"], + ["en-u-fw-thu", "thu"], + ["en-u-fw-fri", "fri"], + ["en-u-fw-sat", "sat"], + ["en-u-fw-sun", "sun"], ]; for (const [id, expected] of validIds) { assert.sameValue( diff --git a/test/intl402/Locale/prototype/firstDayOfWeek/valid-options.js b/test/intl402/Locale/prototype/firstDayOfWeek/valid-options.js index 6f1643afd2..bf6c8507cc 100644 --- a/test/intl402/Locale/prototype/firstDayOfWeek/valid-options.js +++ b/test/intl402/Locale/prototype/firstDayOfWeek/valid-options.js @@ -13,29 +13,29 @@ features: [Intl.Locale,Intl.Locale-info] ---*/ const validFirstDayOfWeekOptions = [ - ["mon", 1], - ["tue", 2], - ["wed", 3], - ["thu", 4], - ["fri", 5], - ["sat", 6], - ["sun", 7], - ["1", 1], - ["2", 2], - ["3", 3], - ["4", 4], - ["5", 5], - ["6", 6], - ["7", 7], - ["0", 7], - [1, 1], - [2, 2], - [3, 3], - [4, 4], - [5, 5], - [6, 6], - [7, 7], - [0, 7], + ["mon", "mon"], + ["tue", "tue"], + ["wed", "wed"], + ["thu", "thu"], + ["fri", "fri"], + ["sat", "sat"], + ["sun", "sun"], + ["1", "mon"], + ["2", "tue"], + ["3", "wed"], + ["4", "thu"], + ["5", "fri"], + ["6", "sat"], + ["7", "sun"], + ["0", "sun"], + [1, "mon"], + [2, "tue"], + [3, "wed"], + [4, "thu"], + [5, "fri"], + [6, "sat"], + [7, "sun"], + [0, "sun"], ]; for (const [firstDayOfWeek, expected] of validFirstDayOfWeekOptions) { assert.sameValue(