diff --git a/test/intl402/DateTimeFormat/constructor-options-order-dayPeriod.js b/test/intl402/DateTimeFormat/constructor-options-order-dayPeriod.js index 446cb08381d..1f7010b25b1 100644 --- a/test/intl402/DateTimeFormat/constructor-options-order-dayPeriod.js +++ b/test/intl402/DateTimeFormat/constructor-options-order-dayPeriod.js @@ -2,14 +2,20 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-initializedatetimeformat +esid: sec-createdatetimeformat description: Checks the order of getting options of 'dayPeriod' for the DateTimeFormat constructor. info: | - ToDateTimeOptions ( options, required, defaults ) - 4. If required is "date" or "any", then - a. For each of the property names "weekday", "year", "month", "day", "dayPeriod" do - 5. If required is "time" or "any", then - a. For each of the property names "hour", "minute", "second", do + CreateDateTimeFormat ( newTarget, locales, options, required, defaults ) + ... + 36. For each row of Table 7, except the header row, in table order, do + a. Let prop be the name given in the Property column of the row. + b. If prop is "fractionalSecondDigits", then + i. Let value be ? GetNumberOption(options, "fractionalSecondDigits", 1, 3, undefined). + c. Else, + i. Let values be a List whose elements are the strings given in the Values column of the row. + ii. Let value be ? GetOption(options, prop, string, values, undefined). + d. Set formatOptions.[[]] to value. + ... includes: [compareArray.js] features: [Intl.DateTimeFormat-dayPeriod] @@ -17,11 +23,7 @@ features: [Intl.DateTimeFormat-dayPeriod] // Just need to ensure dayPeriod are get between day and hour. const expected = [ - // ToDateTimeOptions step 4. - "day", "dayPeriod", - // ToDateTimeOptions step 5. - "hour", - // InitializeDateTimeFormat step 22. + // CreateDateTimeFormat step 36. "day", "dayPeriod", "hour" diff --git a/test/intl402/DateTimeFormat/constructor-options-order-fractionalSecondDigits.js b/test/intl402/DateTimeFormat/constructor-options-order-fractionalSecondDigits.js index 106031af757..a1cf9eed50b 100644 --- a/test/intl402/DateTimeFormat/constructor-options-order-fractionalSecondDigits.js +++ b/test/intl402/DateTimeFormat/constructor-options-order-fractionalSecondDigits.js @@ -3,38 +3,37 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-initializedatetimeformat +esid: sec-createdatetimeformat description: Checks the order of getting options of 'fractionalSecondDigits' for the DateTimeFormat constructor. info: | - ToDateTimeOptions ( options, required, defaults ) - 5. If required is "time" or "any", then - a. For each of the property names "hour", "minute", "second", "fractionalSecondDigits", do - - InitializeDateTimeFormat ( dateTimeFormat, locales, options ) - 2. Let options be ? ToDateTimeOptions(options, "any", "date"). + CreateDateTimeFormat ( newTarget, locales, options, required, defaults ) + ... 4. Let matcher be ? GetOption(options, "localeMatcher", "string", « "lookup", "best fit" », "best fit"). - 22. For each row of Table 5, except the header row, do - a. Let value be ? GetOption(options, prop, "string", « the strings given in the Values column of the row », undefined). - 23. Let _opt_.[[FractionalSecondDigits]] be ? GetNumberOption(_options_, `"fractionalSecondDigits"`, 0, 3, 0). - 26. Let matcher be ? GetOption(options, "formatMatcher", "string", « "basic", "best fit" », "best fit"). + ... + 36. For each row of Table 7, except the header row, in table order, do + a. Let prop be the name given in the Property column of the row. + b. If prop is "fractionalSecondDigits", then + i. Let value be ? GetNumberOption(options, "fractionalSecondDigits", 1, 3, undefined). + c. Else, + i. Let values be a List whose elements are the strings given in the Values column of the row. + ii. Let value be ? GetOption(options, prop, string, values, undefined). + d. Set formatOptions.[[]] to value. + 37. Let matcher be ? GetOption(options, "formatMatcher", "string", « "basic", "best fit" », "best fit"). + ... includes: [compareArray.js] features: [Intl.DateTimeFormat-fractionalSecondDigits] ---*/ // Just need to ensure fractionalSecondDigits are get -// between second and localeMatcher the first time and -// between timeZoneName and formatMatcher the second time. +// between "second" and "timeZoneName". const expected = [ - // InitializeDateTimeFormat step 2. - // ToDateTimeOptions step 5. - "second", "fractionalSecondDigits", - // InitializeDateTimeFormat step 4. + // CreateDateTimeFormat step 4. "localeMatcher", - // InitializeDateTimeFormat step 22. + // CreateDateTimeFormat step 36. "second", "fractionalSecondDigits", "timeZoneName", - // InitializeDateTimeFormat step 26. + // CreateDateTimeFormat step 37. "formatMatcher", ]; diff --git a/test/intl402/DateTimeFormat/constructor-options-order-timedate-style.js b/test/intl402/DateTimeFormat/constructor-options-order-timedate-style.js index 3ea4e79cc5b..6ea1ed28a47 100644 --- a/test/intl402/DateTimeFormat/constructor-options-order-timedate-style.js +++ b/test/intl402/DateTimeFormat/constructor-options-order-timedate-style.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-initializedatetimeformat +esid: sec-createdatetimeformat description: Checks the order of getting options for the DateTimeFormat constructor. includes: [compareArray.js] features: [Intl.DateTimeFormat-datetimestyle] @@ -11,24 +11,15 @@ features: [Intl.DateTimeFormat-datetimestyle] // To be merged into constructor-options-order.js when the feature is removed. const expected = [ - // ToDateTimeOptions step 4. - "weekday", "year", "month", "day", - // ToDateTimeOptions step 5. - "hour", "minute", "second", - // ToDateTimeOptions step 6. - "dateStyle", - // ToDateTimeOptions step 7. - "timeStyle", - - // InitializeDateTimeFormat step 4. + // CreateDateTimeFormat step 4. "localeMatcher", - // InitializeDateTimeFormat step 6. + // CreateDateTimeFormat step 12. "hour12", - // InitializeDateTimeFormat step 7. + // CreateDateTimeFormat step 13. "hourCycle", - // InitializeDateTimeFormat step 23. + // CreateDateTimeFormat step 29. "timeZone", - // InitializeDateTimeFormat step 28. + // CreateDateTimeFormat step 36. "weekday", "era", "year", @@ -39,9 +30,9 @@ const expected = [ "second", "timeZoneName", "formatMatcher", - // InitializeDateTimeFormat step 32. + // CreateDateTimeFormat step 38. "dateStyle", - // InitializeDateTimeFormat step 33. + // CreateDateTimeFormat step 40. "timeStyle", ]; diff --git a/test/intl402/DateTimeFormat/constructor-options-order.js b/test/intl402/DateTimeFormat/constructor-options-order.js index 9932f6b1294..fa626f0dffc 100644 --- a/test/intl402/DateTimeFormat/constructor-options-order.js +++ b/test/intl402/DateTimeFormat/constructor-options-order.js @@ -2,26 +2,21 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-initializedatetimeformat +esid: sec-createdatetimeformat description: Checks the order of getting options for the DateTimeFormat constructor. includes: [compareArray.js] ---*/ const expected = [ - // ToDateTimeOptions step 4. - "weekday", "year", "month", "day", - // ToDateTimeOptions step 5. - "hour", "minute", "second", - - // InitializeDateTimeFormat step 4. + // CreateDateTimeFormat step 4. "localeMatcher", - // InitializeDateTimeFormat step 6. + // CreateDateTimeFormat step 12. "hour12", - // InitializeDateTimeFormat step 7. + // CreateDateTimeFormat step 13. "hourCycle", - // InitializeDateTimeFormat step 17. + // CreateDateTimeFormat step 29. "timeZone", - // InitializeDateTimeFormat step 22. + // CreateDateTimeFormat step 36. "weekday", "era", "year", @@ -31,7 +26,7 @@ const expected = [ "minute", "second", "timeZoneName", - // InitializeDateTimeFormat step 25. + // CreateDateTimeFormat step 37. "formatMatcher", ];