From 84ec4a78934825464511408e64e7f0a488f3c3e6 Mon Sep 17 00:00:00 2001 From: Frank Tang Date: Sat, 17 Jul 2021 02:02:40 -0700 Subject: [PATCH 1/4] Add tests for Temporal.Calendar.prototype.(year|month*|day) --- .../Temporal/Calendar/prototype/day/simple.js | 22 +++++++++++++++++ .../Calendar/prototype/month-code/simple.js | 23 ++++++++++++++++++ .../Calendar/prototype/month/simple.js | 24 +++++++++++++++++++ .../prototype/month/throws-type-error.js | 22 +++++++++++++++++ .../Calendar/prototype/year/simple.js | 22 +++++++++++++++++ 5 files changed, 113 insertions(+) create mode 100644 test/built-ins/Temporal/Calendar/prototype/day/simple.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/month-code/simple.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/month/simple.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/month/throws-type-error.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/year/simple.js diff --git a/test/built-ins/Temporal/Calendar/prototype/day/simple.js b/test/built-ins/Temporal/Calendar/prototype/day/simple.js new file mode 100644 index 00000000000..0b3a3504d7b --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/day/simple.js @@ -0,0 +1,22 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.day +description: Temporal.Calendar.prototype.day will take different kind of objects. + and return the value of the day. +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. If Type(temporalDateLike) is not Object or temporalDateLike does not have an [[InitializedTemporalDate]] or [[InitializedTemporalMonthDay]] internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 5. Return ! ISODay(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +assert.sameValue(15, cal.day(new Temporal.PlainDate(2021, 7, 15))); +assert.sameValue(23, cal.day(new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13))); +assert.sameValue(6, cal.day(new Temporal.PlainMonthDay(2, 6))); +assert.sameValue(18, cal.day("2019-03-18")); diff --git a/test/built-ins/Temporal/Calendar/prototype/month-code/simple.js b/test/built-ins/Temporal/Calendar/prototype/month-code/simple.js new file mode 100644 index 00000000000..80cec7a133d --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/month-code/simple.js @@ -0,0 +1,23 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.monthcode +description: Temporal.Calendar.prototype.monthCode will take different kind of object and return + the value of the monthCode. +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. If Type(temporalDateLike) is not Object or temporalDateLike does not have an [[InitializedTemporalDate]], [[InitializedTemporalMonthDay]], or [[InitializedTemporalYearMonth]] internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 5. Return ! ISOMonthCode(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +assert.sameValue("M07", cal.monthCode(new Temporal.PlainDate(2021, 7, 15))); +assert.sameValue("M08", cal.monthCode(new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13))); +assert.sameValue("M06", cal.monthCode(new Temporal.PlainYearMonth(1999, 6))); +assert.sameValue("M02", cal.monthCode(new Temporal.PlainMonthDay(2, 6))); +assert.sameValue("M03", cal.monthCode("2019-03-15")); diff --git a/test/built-ins/Temporal/Calendar/prototype/month/simple.js b/test/built-ins/Temporal/Calendar/prototype/month/simple.js new file mode 100644 index 00000000000..7a56c6de621 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/month/simple.js @@ -0,0 +1,24 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.month +description: Temporal.Calendar.prototype.month will take different kind of object and + return month value. +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. If Type(temporalDateLike) is Object and temporalDateLike has an [[InitializedTemporalMonthDay]] internal slot, then + a. Throw a TypeError exception. + 5. If Type(temporalDateLike) is not Object or temporalDateLike does not have an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 6. Return ! ISOMonth(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +assert.sameValue(7, cal.month(new Temporal.PlainDate(2021, 7, 15))); +assert.sameValue(8, cal.month(new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13))); +assert.sameValue(6, cal.month(new Temporal.PlainYearMonth(1999, 6))); +assert.sameValue(3, cal.month("2019-03-15")); diff --git a/test/built-ins/Temporal/Calendar/prototype/month/throws-type-error.js b/test/built-ins/Temporal/Calendar/prototype/month/throws-type-error.js new file mode 100644 index 00000000000..25672888515 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/month/throws-type-error.js @@ -0,0 +1,22 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.month +description: Temporal.Calendar.prototype.month will throws TypeError while the input object + has an [[InitializedTemporalMonthDay]] internal slot. +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. If Type(temporalDateLike) is Object and temporalDateLike has an [[InitializedTemporalMonthDay]] internal slot, then + a. Throw a TypeError exception. + 5. If Type(temporalDateLike) is not Object or temporalDateLike does not have an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 6. Return ! ISOMonth(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +assert.throws(TypeError, () => cal.month(new Temporal.PlainMonthDay(3, 16)), + "invalid_argument"); diff --git a/test/built-ins/Temporal/Calendar/prototype/year/simple.js b/test/built-ins/Temporal/Calendar/prototype/year/simple.js new file mode 100644 index 00000000000..9563bf4d640 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/year/simple.js @@ -0,0 +1,22 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.year +description: Temporal.Calendar.prototype.year will take different kind of object and return + the value of the year. +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. If Type(temporalDateLike) is not Object or temporalDateLike does not have an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 5. Return ! ISOYear(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +assert.sameValue(2021, cal.year(new Temporal.PlainDate(2021, 7, 15))); +assert.sameValue(1997, cal.year(new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13))); +assert.sameValue(1999, cal.year(new Temporal.PlainYearMonth(1999, 6))); +assert.sameValue(2019, cal.year("2019-03-15")); From 6cdf7dabb5948255ed3323a361af934c651316b4 Mon Sep 17 00:00:00 2001 From: Frank Tang Date: Mon, 19 Jul 2021 11:15:56 -0700 Subject: [PATCH 2/4] Fix directory name --- .../Calendar/prototype/{month-code => monthCode}/simple.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/built-ins/Temporal/Calendar/prototype/{month-code => monthCode}/simple.js (100%) diff --git a/test/built-ins/Temporal/Calendar/prototype/month-code/simple.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/simple.js similarity index 100% rename from test/built-ins/Temporal/Calendar/prototype/month-code/simple.js rename to test/built-ins/Temporal/Calendar/prototype/monthCode/simple.js From cf36a5008df25666b7ffb7aa2de7d8d20e2a0206 Mon Sep 17 00:00:00 2001 From: Frank Tang Date: Wed, 4 Aug 2021 22:21:07 -0700 Subject: [PATCH 3/4] Split to different files and test throwing Error --- .../Calendar/prototype/day/date-time.js | 15 ++++++++++++ .../Temporal/Calendar/prototype/day/date.js | 15 ++++++++++++ .../Calendar/prototype/day/month-day.js | 19 +++++++++++++++ .../Temporal/Calendar/prototype/day/string.js | 18 ++++++++++++++ .../day/throw-range-error-ToTemporalDate.js | 18 ++++++++++++++ .../throw-type-error-RequireInternalSlot.js | 15 ++++++++++++ .../Calendar/prototype/month/date-time.js | 19 +++++++++++++++ .../month/{throws-type-error.js => date.js} | 19 ++++++++------- .../month/month-day-throw-type-error.js | 19 +++++++++++++++ .../Calendar/prototype/month/simple.js | 24 ------------------- .../Calendar/prototype/month/string.js | 18 ++++++++++++++ .../month/throw-range-error-ToTemporalDate.js | 18 ++++++++++++++ .../throw-type-error-RequireInternalSlot.js | 15 ++++++++++++ .../Calendar/prototype/month/year-month.js | 15 ++++++++++++ .../Calendar/prototype/monthCode/date-time.js | 15 ++++++++++++ .../Calendar/prototype/monthCode/date.js | 15 ++++++++++++ .../Calendar/prototype/monthCode/month-day.js | 12 ++++++++++ .../Calendar/prototype/monthCode/simple.js | 23 ------------------ .../Calendar/prototype/monthCode/string.js | 17 +++++++++++++ .../throw-range-error-ToTemporalDate.js | 18 ++++++++++++++ .../throw-type-error-RequireInternalSlot.js | 15 ++++++++++++ .../prototype/monthCode/year-month.js | 15 ++++++++++++ .../{day/simple.js => year/date-time.js} | 16 ++++++------- .../Temporal/Calendar/prototype/year/date.js | 20 ++++++++++++++++ .../prototype/year/{simple.js => string.js} | 5 +--- .../year/throw-range-error-ToTemporalDate.js | 18 ++++++++++++++ .../throw-type-error-RequireInternalSlot.js | 16 +++++++++++++ .../Calendar/prototype/year/year-month.js | 20 ++++++++++++++++ 28 files changed, 404 insertions(+), 68 deletions(-) create mode 100644 test/built-ins/Temporal/Calendar/prototype/day/date-time.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/day/date.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/day/month-day.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/day/string.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/day/throw-range-error-ToTemporalDate.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/day/throw-type-error-RequireInternalSlot.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/month/date-time.js rename test/built-ins/Temporal/Calendar/prototype/month/{throws-type-error.js => date.js} (54%) create mode 100644 test/built-ins/Temporal/Calendar/prototype/month/month-day-throw-type-error.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/month/simple.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/month/string.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/month/throw-range-error-ToTemporalDate.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/month/throw-type-error-RequireInternalSlot.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/month/year-month.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/monthCode/date-time.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/monthCode/date.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/monthCode/month-day.js delete mode 100644 test/built-ins/Temporal/Calendar/prototype/monthCode/simple.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/monthCode/string.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/monthCode/throw-range-error-ToTemporalDate.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/monthCode/throw-type-error-RequireInternalSlot.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/monthCode/year-month.js rename test/built-ins/Temporal/Calendar/prototype/{day/simple.js => year/date-time.js} (54%) create mode 100644 test/built-ins/Temporal/Calendar/prototype/year/date.js rename test/built-ins/Temporal/Calendar/prototype/year/{simple.js => string.js} (70%) create mode 100644 test/built-ins/Temporal/Calendar/prototype/year/throw-range-error-ToTemporalDate.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/year/throw-type-error-RequireInternalSlot.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/year/year-month.js diff --git a/test/built-ins/Temporal/Calendar/prototype/day/date-time.js b/test/built-ins/Temporal/Calendar/prototype/day/date-time.js new file mode 100644 index 00000000000..63e60caff48 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/day/date-time.js @@ -0,0 +1,15 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.day +description: Temporal.Calendar.prototype.day will take PlainDateTime and return + the value of the day. +info: | + 5. Return ! ISODay(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let dateTime = new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13) +assert.sameValue(23, cal.day(dateTime)); diff --git a/test/built-ins/Temporal/Calendar/prototype/day/date.js b/test/built-ins/Temporal/Calendar/prototype/day/date.js new file mode 100644 index 00000000000..fa93e7a34ac --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/day/date.js @@ -0,0 +1,15 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.day +description: Temporal.Calendar.prototype.day will take PlainDate and return + the value of the day. +info: | + 5. Return ! ISODay(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let date = new Temporal.PlainDate(2021, 7, 15); +assert.sameValue(15, cal.day(date)); diff --git a/test/built-ins/Temporal/Calendar/prototype/day/month-day.js b/test/built-ins/Temporal/Calendar/prototype/day/month-day.js new file mode 100644 index 00000000000..8e90d294728 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/day/month-day.js @@ -0,0 +1,19 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.day +description: Temporal.Calendar.prototype.day will take PlainMonthDay and return + the value of the day. +info: | + 4. If Type(temporalDateLike) is not Object or temporalDateLike does not have + an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] internal + slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 5. Return ! ISODay(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let monthDay = new Temporal.PlainMonthDay(7, 15); +assert.sameValue(15, cal.day(monthDay)); diff --git a/test/built-ins/Temporal/Calendar/prototype/day/string.js b/test/built-ins/Temporal/Calendar/prototype/day/string.js new file mode 100644 index 00000000000..2aff7684cfe --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/day/string.js @@ -0,0 +1,18 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.day +description: Temporal.Calendar.prototype.day will take ISO8601 string and return + the value of the day. +info: | + 4. If Type(temporalDateLike) is not Object or temporalDateLike does not have + an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] internal + slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 5. Return ! ISODay(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +assert.sameValue(15, cal.day("2019-03-15")); diff --git a/test/built-ins/Temporal/Calendar/prototype/day/throw-range-error-ToTemporalDate.js b/test/built-ins/Temporal/Calendar/prototype/day/throw-range-error-ToTemporalDate.js new file mode 100644 index 00000000000..91ab2b41821 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/day/throw-range-error-ToTemporalDate.js @@ -0,0 +1,18 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.day +description: Temporal.Calendar.prototype.day throws RangeError on + ToTemporalDate when temporalDateLike is invalid string. +info: | + 4. If Type(temporalDateLike) is not Object or temporalDateLike + does not have an [[InitializedTemporalDate]] or + [[InitializedTemporalYearMonth]] internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +assert.throws(RangeError, () => cal.day("invalid string"), + "Throw RangeError if temporalDateLike is invalid"); diff --git a/test/built-ins/Temporal/Calendar/prototype/day/throw-type-error-RequireInternalSlot.js b/test/built-ins/Temporal/Calendar/prototype/day/throw-type-error-RequireInternalSlot.js new file mode 100644 index 00000000000..8a57475f616 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/day/throw-type-error-RequireInternalSlot.js @@ -0,0 +1,15 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.day +description: Temporal.Calendar.prototype.day throws TypeError on RequireInternalSlot if object has no internal slot. +info: | + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let badCal = { day: cal.day } +assert.throws(TypeError, () => badCal.day("2021-03-04"), + "Throw TypeError if there are no internal slot"); diff --git a/test/built-ins/Temporal/Calendar/prototype/month/date-time.js b/test/built-ins/Temporal/Calendar/prototype/month/date-time.js new file mode 100644 index 00000000000..a2374317e24 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/month/date-time.js @@ -0,0 +1,19 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.month +description: Temporal.Calendar.prototype.month will take PlainDateTime and return + the value of the month. +info: | + 5. If Type(temporalDateLike) is not Object or temporalDateLike does not have + an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] + internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 6. Return ! ISOMonth(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let dateTime = new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13) +assert.sameValue(8, cal.month(dateTime)); diff --git a/test/built-ins/Temporal/Calendar/prototype/month/throws-type-error.js b/test/built-ins/Temporal/Calendar/prototype/month/date.js similarity index 54% rename from test/built-ins/Temporal/Calendar/prototype/month/throws-type-error.js rename to test/built-ins/Temporal/Calendar/prototype/month/date.js index 25672888515..0fda0dd126a 100644 --- a/test/built-ins/Temporal/Calendar/prototype/month/throws-type-error.js +++ b/test/built-ins/Temporal/Calendar/prototype/month/date.js @@ -3,20 +3,23 @@ /*--- esid: sec-temporal.calendar.prototype.month -description: Temporal.Calendar.prototype.month will throws TypeError while the input object - has an [[InitializedTemporalMonthDay]] internal slot. +description: Temporal.Calendar.prototype.month will take PlainDate and return + the value of the month. info: | 1. Let calendar be the this value. 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). 3. Assert: calendar.[[Identifier]] is "iso8601". - 4. If Type(temporalDateLike) is Object and temporalDateLike has an [[InitializedTemporalMonthDay]] internal slot, then - a. Throw a TypeError exception. - 5. If Type(temporalDateLike) is not Object or temporalDateLike does not have an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] internal slot, then - a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 4. If Type(temporalDateLike) is Object and temporalDateLike has an + [[InitializedTemporalMonthDay]] internal slot, then + a. Throw a TypeError exception. + 5. If Type(temporalDateLike) is not Object or temporalDateLike does not have + an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] + internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). 6. Return ! ISOMonth(temporalDateLike). features: [Temporal] ---*/ let cal = new Temporal.Calendar("iso8601"); -assert.throws(TypeError, () => cal.month(new Temporal.PlainMonthDay(3, 16)), - "invalid_argument"); +let date = new Temporal.PlainDate(2021, 7, 15); +assert.sameValue(7, cal.month(date)); diff --git a/test/built-ins/Temporal/Calendar/prototype/month/month-day-throw-type-error.js b/test/built-ins/Temporal/Calendar/prototype/month/month-day-throw-type-error.js new file mode 100644 index 00000000000..0363a7f07a4 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/month/month-day-throw-type-error.js @@ -0,0 +1,19 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.month +description: Temporal.Calendar.prototype.month throws TypeError if temporalDateLike + is a PlainMonthDay object. + ToTemporalDate when temporalDateLike is invalid string. +info: | + 4. If Type(temporalDateLike) is Object and temporalDateLike has an + [[InitializedTemporalMonthDay]] internal slot, then + a. Throw a TypeError exception. +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let monthDay = new Temporal.PlainMonthDay(12, 25); +assert.throws(TypeError, () => cal.month(monthDay), + "Throw TypeError if temporalDateLike is a PlainMonthDay"); diff --git a/test/built-ins/Temporal/Calendar/prototype/month/simple.js b/test/built-ins/Temporal/Calendar/prototype/month/simple.js deleted file mode 100644 index 7a56c6de621..00000000000 --- a/test/built-ins/Temporal/Calendar/prototype/month/simple.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.calendar.prototype.month -description: Temporal.Calendar.prototype.month will take different kind of object and - return month value. -info: | - 1. Let calendar be the this value. - 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). - 3. Assert: calendar.[[Identifier]] is "iso8601". - 4. If Type(temporalDateLike) is Object and temporalDateLike has an [[InitializedTemporalMonthDay]] internal slot, then - a. Throw a TypeError exception. - 5. If Type(temporalDateLike) is not Object or temporalDateLike does not have an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] internal slot, then - a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). - 6. Return ! ISOMonth(temporalDateLike). -features: [Temporal] ----*/ -let cal = new Temporal.Calendar("iso8601"); - -assert.sameValue(7, cal.month(new Temporal.PlainDate(2021, 7, 15))); -assert.sameValue(8, cal.month(new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13))); -assert.sameValue(6, cal.month(new Temporal.PlainYearMonth(1999, 6))); -assert.sameValue(3, cal.month("2019-03-15")); diff --git a/test/built-ins/Temporal/Calendar/prototype/month/string.js b/test/built-ins/Temporal/Calendar/prototype/month/string.js new file mode 100644 index 00000000000..16ac2134401 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/month/string.js @@ -0,0 +1,18 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.month +description: Temporal.Calendar.prototype.month will take ISO8601 string and return + the value of the month. +info: | + 5. If Type(temporalDateLike) is not Object or temporalDateLike does not have + an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] internal + slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 6. Return ! ISOMonth(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +assert.sameValue(3, cal.month("2019-03-15")); diff --git a/test/built-ins/Temporal/Calendar/prototype/month/throw-range-error-ToTemporalDate.js b/test/built-ins/Temporal/Calendar/prototype/month/throw-range-error-ToTemporalDate.js new file mode 100644 index 00000000000..9e173c4675e --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/month/throw-range-error-ToTemporalDate.js @@ -0,0 +1,18 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.month +description: Temporal.Calendar.prototype.month throws RangeError on + ToTemporalDate when temporalDateLike is invalid string. +info: | + 5. If Type(temporalDateLike) is not Object or temporalDateLike + does not have an [[InitializedTemporalDate]] or + [[InitializedTemporalYearMonth]] internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +assert.throws(RangeError, () => cal.month("invalid string"), + "Throw RangeError if temporalDateLike is invalid"); diff --git a/test/built-ins/Temporal/Calendar/prototype/month/throw-type-error-RequireInternalSlot.js b/test/built-ins/Temporal/Calendar/prototype/month/throw-type-error-RequireInternalSlot.js new file mode 100644 index 00000000000..9b936d8f706 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/month/throw-type-error-RequireInternalSlot.js @@ -0,0 +1,15 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.month +description: Temporal.Calendar.prototype.month throws TypeError on RequireInternalSlot if object has no internal slot. +info: | + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let badCal = { month: cal.month } +assert.throws(TypeError, () => badCal.month("2021-03-04"), + "Throw TypeError if there are no internal slot"); diff --git a/test/built-ins/Temporal/Calendar/prototype/month/year-month.js b/test/built-ins/Temporal/Calendar/prototype/month/year-month.js new file mode 100644 index 00000000000..c9811be36cf --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/month/year-month.js @@ -0,0 +1,15 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.month +description: Temporal.Calendar.prototype.month will take PlainYearMonth and return + the value of the month. +info: | + 6. Return ! ISOMonth(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let yearMonth = new Temporal.PlainYearMonth(1999, 6); +assert.sameValue(6, cal.month(yearMonth)); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthCode/date-time.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/date-time.js new file mode 100644 index 00000000000..eb78e0fa22f --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/monthCode/date-time.js @@ -0,0 +1,15 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.monthCode +description: Temporal.Calendar.prototype.month will take PlainDateTime and return + the value of the monthCode. +info: | + 6. Return ! ISOMonthCode(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let dateTime = new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13) +assert.sameValue("M08", cal.monthCode(dateTime)); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthCode/date.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/date.js new file mode 100644 index 00000000000..6802fc2355b --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/monthCode/date.js @@ -0,0 +1,15 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.monthCode +description: Temporal.Calendar.prototype.monthCode will take PlainDate and return + the value of the monthCode. +info: | + 5. Return ! ISOMonthCode(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let date = new Temporal.PlainDate(2021, 7, 15); +assert.sameValue("M07", cal.monthCode(date)); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthCode/month-day.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/month-day.js new file mode 100644 index 00000000000..5d009ed40bf --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/monthCode/month-day.js @@ -0,0 +1,12 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.monthCode + 6. Return ! ISOMonthCode(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let monthDay = new Temporal.PlainMonthDay(12, 25); +assert.sameValue("M12", cal.monthCode(monthDay)); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthCode/simple.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/simple.js deleted file mode 100644 index 80cec7a133d..00000000000 --- a/test/built-ins/Temporal/Calendar/prototype/monthCode/simple.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.calendar.prototype.monthcode -description: Temporal.Calendar.prototype.monthCode will take different kind of object and return - the value of the monthCode. -info: | - 1. Let calendar be the this value. - 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). - 3. Assert: calendar.[[Identifier]] is "iso8601". - 4. If Type(temporalDateLike) is not Object or temporalDateLike does not have an [[InitializedTemporalDate]], [[InitializedTemporalMonthDay]], or [[InitializedTemporalYearMonth]] internal slot, then - a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). - 5. Return ! ISOMonthCode(temporalDateLike). -features: [Temporal] ----*/ -let cal = new Temporal.Calendar("iso8601"); - -assert.sameValue("M07", cal.monthCode(new Temporal.PlainDate(2021, 7, 15))); -assert.sameValue("M08", cal.monthCode(new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13))); -assert.sameValue("M06", cal.monthCode(new Temporal.PlainYearMonth(1999, 6))); -assert.sameValue("M02", cal.monthCode(new Temporal.PlainMonthDay(2, 6))); -assert.sameValue("M03", cal.monthCode("2019-03-15")); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthCode/string.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/string.js new file mode 100644 index 00000000000..db703753d9b --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/monthCode/string.js @@ -0,0 +1,17 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.monthCode +description: Temporal.Calendar.prototype.monthCode will take ISO8601 string and return + the value of the monthCode. +info: | + 5. If Type(temporalDateLike) is not Object or temporalDateLike does not have + an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] internal + slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 6. Return ! ISOYear(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); +assert.sameValue("M03", cal.monthCode("2019-03-15")); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthCode/throw-range-error-ToTemporalDate.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/throw-range-error-ToTemporalDate.js new file mode 100644 index 00000000000..2528eeeeed4 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/monthCode/throw-range-error-ToTemporalDate.js @@ -0,0 +1,18 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.monthCode +description: Temporal.Calendar.prototype.monthCode throws RangeError on + ToTemporalDate when temporalDateLike is invalid string. +info: | + 4. If Type(temporalDateLike) is not Object or temporalDateLike + does not have an [[InitializedTemporalDate]] or + [[InitializedTemporalYearMonth]] internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +assert.throws(RangeError, () => cal.monthCode("invalid string"), + "Throw RangeError if temporalDateLike is invalid"); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthCode/throw-type-error-RequireInternalSlot.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/throw-type-error-RequireInternalSlot.js new file mode 100644 index 00000000000..8f1a80c8738 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/monthCode/throw-type-error-RequireInternalSlot.js @@ -0,0 +1,15 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.monthCode +description: Temporal.Calendar.prototype.monthCode throws TypeError on RequireInternalSlot if object has no internal slot. +info: | + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let badCal = { monthCode: cal.monthCode} +assert.throws(TypeError, () => badCal.monthCode("2021-03-04"), + "Throw TypeError if there are no internal slot"); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthCode/year-month.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/year-month.js new file mode 100644 index 00000000000..62d53d2d545 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/monthCode/year-month.js @@ -0,0 +1,15 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.monthCode +description: Temporal.Calendar.prototype.monthCode will take PlainYearMonth and return + the value of the monthCode. +info: | + 6. Return ! ISOMonthCode(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let yearMonth = new Temporal.PlainYearMonth(1999, 6); +assert.sameValue("M06", cal.monthCode(yearMonth)); diff --git a/test/built-ins/Temporal/Calendar/prototype/day/simple.js b/test/built-ins/Temporal/Calendar/prototype/year/date-time.js similarity index 54% rename from test/built-ins/Temporal/Calendar/prototype/day/simple.js rename to test/built-ins/Temporal/Calendar/prototype/year/date-time.js index 0b3a3504d7b..a6044f53bbb 100644 --- a/test/built-ins/Temporal/Calendar/prototype/day/simple.js +++ b/test/built-ins/Temporal/Calendar/prototype/year/date-time.js @@ -2,21 +2,19 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-temporal.calendar.prototype.day -description: Temporal.Calendar.prototype.day will take different kind of objects. - and return the value of the day. +esid: sec-temporal.calendar.prototype.year +description: Temporal.Calendar.prototype.year will take PlainDateTime and return + the value of the year. info: | 1. Let calendar be the this value. 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). 3. Assert: calendar.[[Identifier]] is "iso8601". - 4. If Type(temporalDateLike) is not Object or temporalDateLike does not have an [[InitializedTemporalDate]] or [[InitializedTemporalMonthDay]] internal slot, then + 4. If Type(temporalDateLike) is not Object or temporalDateLike does not have an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] internal slot, then a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). - 5. Return ! ISODay(temporalDateLike). + 5. Return ! ISOYear(temporalDateLike). features: [Temporal] ---*/ let cal = new Temporal.Calendar("iso8601"); -assert.sameValue(15, cal.day(new Temporal.PlainDate(2021, 7, 15))); -assert.sameValue(23, cal.day(new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13))); -assert.sameValue(6, cal.day(new Temporal.PlainMonthDay(2, 6))); -assert.sameValue(18, cal.day("2019-03-18")); +let dateTime = new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13) +assert.sameValue(1997, cal.year(dateTime)); diff --git a/test/built-ins/Temporal/Calendar/prototype/year/date.js b/test/built-ins/Temporal/Calendar/prototype/year/date.js new file mode 100644 index 00000000000..2afec4ccfc6 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/year/date.js @@ -0,0 +1,20 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.year +description: Temporal.Calendar.prototype.year will take PlainDate and return + the value of the year. +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. If Type(temporalDateLike) is not Object or temporalDateLike does not have an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 5. Return ! ISOYear(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let date = new Temporal.PlainDate(2021, 7, 15); +assert.sameValue(2021, cal.year(date)); diff --git a/test/built-ins/Temporal/Calendar/prototype/year/simple.js b/test/built-ins/Temporal/Calendar/prototype/year/string.js similarity index 70% rename from test/built-ins/Temporal/Calendar/prototype/year/simple.js rename to test/built-ins/Temporal/Calendar/prototype/year/string.js index 9563bf4d640..20dc9420cf1 100644 --- a/test/built-ins/Temporal/Calendar/prototype/year/simple.js +++ b/test/built-ins/Temporal/Calendar/prototype/year/string.js @@ -3,7 +3,7 @@ /*--- esid: sec-temporal.calendar.prototype.year -description: Temporal.Calendar.prototype.year will take different kind of object and return +description: Temporal.Calendar.prototype.year will take ISO8601 string and return the value of the year. info: | 1. Let calendar be the this value. @@ -16,7 +16,4 @@ features: [Temporal] ---*/ let cal = new Temporal.Calendar("iso8601"); -assert.sameValue(2021, cal.year(new Temporal.PlainDate(2021, 7, 15))); -assert.sameValue(1997, cal.year(new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13))); -assert.sameValue(1999, cal.year(new Temporal.PlainYearMonth(1999, 6))); assert.sameValue(2019, cal.year("2019-03-15")); diff --git a/test/built-ins/Temporal/Calendar/prototype/year/throw-range-error-ToTemporalDate.js b/test/built-ins/Temporal/Calendar/prototype/year/throw-range-error-ToTemporalDate.js new file mode 100644 index 00000000000..24af39704e4 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/year/throw-range-error-ToTemporalDate.js @@ -0,0 +1,18 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.year +description: Temporal.Calendar.prototype.year throws RangeError on + ToTemporalDate when temporalDateLike is invalid string. +info: | + 4. If Type(temporalDateLike) is not Object or temporalDateLike + does not have an [[InitializedTemporalDate]] or + [[InitializedTemporalYearMonth]] internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +assert.throws(RangeError, () => cal.year("invalid string"), + "Throw RangeError if temporalDateLike is invalid"); diff --git a/test/built-ins/Temporal/Calendar/prototype/year/throw-type-error-RequireInternalSlot.js b/test/built-ins/Temporal/Calendar/prototype/year/throw-type-error-RequireInternalSlot.js new file mode 100644 index 00000000000..7439865a5da --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/year/throw-type-error-RequireInternalSlot.js @@ -0,0 +1,16 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.year +description: Temporal.Calendar.prototype.year throws TypeError on + RequireInternalSlot if object has no internal slot. +info: | + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let badCal = { year: cal.year } +assert.throws(TypeError, () => badCal.year("2021-03-04"), + "Throw TypeError if there are no internal slot"); diff --git a/test/built-ins/Temporal/Calendar/prototype/year/year-month.js b/test/built-ins/Temporal/Calendar/prototype/year/year-month.js new file mode 100644 index 00000000000..eefbdf75d90 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/year/year-month.js @@ -0,0 +1,20 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.year +description: Temporal.Calendar.prototype.year will take PlainYearMonth and return + the value of the year. +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. If Type(temporalDateLike) is not Object or temporalDateLike does not have an [[InitializedTemporalDate]] or [[InitializedTemporalYearMonth]] internal slot, then + a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). + 5. Return ! ISOYear(temporalDateLike). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +let yearMonth = new Temporal.PlainYearMonth(1999, 6); +assert.sameValue(1999, cal.year(yearMonth)); From cedd280c4149003a05390e0a15fc0985eb44bfe4 Mon Sep 17 00:00:00 2001 From: Frank Tang Date: Thu, 5 Aug 2021 14:33:19 -0700 Subject: [PATCH 4/4] fix id --- .../Temporal/Calendar/prototype/monthCode/month-day.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/built-ins/Temporal/Calendar/prototype/monthCode/month-day.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/month-day.js index 5d009ed40bf..48fe504735c 100644 --- a/test/built-ins/Temporal/Calendar/prototype/monthCode/month-day.js +++ b/test/built-ins/Temporal/Calendar/prototype/monthCode/month-day.js @@ -3,6 +3,9 @@ /*--- esid: sec-temporal.calendar.prototype.monthCode +description: Temporal.Calendar.prototype.monthCode will take PlainMonthDay and return + the value of the monthCode. +info: | 6. Return ! ISOMonthCode(temporalDateLike). features: [Temporal] ---*/