From c898b68ef6efa429f2fbd8945d8f92cb8cda8111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Balbonti=CC=81n?= Date: Thu, 3 Dec 2020 00:16:49 -0700 Subject: [PATCH] Update the description of some Intl.DateTimeFormat formatRange(ToParts) tests based on changes introduced in tc39/proposal-intl-DateTimeFormat-formatRange#23 --- .../formatRange/date-x-greater-than-y-throws.js | 17 +++++++++++------ .../date-x-greater-than-y-throws.js | 17 +++++++++++------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/test/intl402/DateTimeFormat/prototype/formatRange/date-x-greater-than-y-throws.js b/test/intl402/DateTimeFormat/prototype/formatRange/date-x-greater-than-y-throws.js index 587c967a3e..57e6ae592b 100644 --- a/test/intl402/DateTimeFormat/prototype/formatRange/date-x-greater-than-y-throws.js +++ b/test/intl402/DateTimeFormat/prototype/formatRange/date-x-greater-than-y-throws.js @@ -6,13 +6,18 @@ description: > Throws a RangeError if date x is greater than y. info: | Intl.DateTimeFormat.prototype.formatRange ( startDate , endDate ) + + 4. Let x be ? ToNumber(startDate). + 5. Let y be ? ToNumber(endDate). + 6. Return ? FormatDateTimeRange(dtf, x, y). - 1. Let dtf be this value. - 2. If Type(dtf) is not Object, throw a TypeError exception. - 3. If dtf does not have an [[InitializedDateTimeFormat]] internal slot, throw a TypeError exception. - 5. Let x be ? ToNumber(startDate). - 6. Let y be ? ToNumber(endDate). - 7. If x is greater than y, throw a RangeError exception. + PartitionDateTimeRangePattern ( dateTimeFormat, x, y ) + + 1. Let x be TimeClip(x). + 2. If x is NaN, throw a RangeError exception. + 3. Let y be TimeClip(y). + 4. If y is NaN, throw a RangeError exception. + 5. If x is greater than y, throw a RangeError exception. features: [Intl.DateTimeFormat-formatRange] ---*/ diff --git a/test/intl402/DateTimeFormat/prototype/formatRangeToParts/date-x-greater-than-y-throws.js b/test/intl402/DateTimeFormat/prototype/formatRangeToParts/date-x-greater-than-y-throws.js index 11b47ee399..c7c095bf0f 100644 --- a/test/intl402/DateTimeFormat/prototype/formatRangeToParts/date-x-greater-than-y-throws.js +++ b/test/intl402/DateTimeFormat/prototype/formatRangeToParts/date-x-greater-than-y-throws.js @@ -7,12 +7,17 @@ description: > info: | Intl.DateTimeFormat.prototype.formatRangeToParts ( startDate , endDate ) - 1. Let dtf be this value. - 2. If Type(dtf) is not Object, throw a TypeError exception. - 3. If dtf does not have an [[InitializedDateTimeFormat]] internal slot, throw a TypeError exception. - 5. Let x be ? ToNumber(startDate). - 6. Let y be ? ToNumber(endDate). - 7. If x is greater than y, throw a RangeError exception. + 4. Let x be ? ToNumber(startDate). + 5. Let y be ? ToNumber(endDate). + 6. Return ? FormatDateTimeRangeToParts(dtf, x, y). + + PartitionDateTimeRangePattern ( dateTimeFormat, x, y ) + + 1. Let x be TimeClip(x). + 2. If x is NaN, throw a RangeError exception. + 3. Let y be TimeClip(y). + 4. If y is NaN, throw a RangeError exception. + 5. If x is greater than y, throw a RangeError exception. features: [Intl.DateTimeFormat-formatRange] ---*/