-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88d1ede
commit 86e2399
Showing
15 changed files
with
204 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
test/built-ins/Temporal/Calendar/prototype/daysInMonth/throw-range-error-ToTemporalDate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.daysInMonth | ||
description: Temporal.Calendar.prototype.daysInMonth 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 | ||
slots, then | ||
a. Set temporalDateLike to ? ToTemporalDate(temporalDateLike). | ||
features: [Temporal] | ||
---*/ | ||
let cal = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(RangeError, () => cal.daysInMonth("invalid string"), | ||
"Throw RangeError if temporalDateLike is invalid"); |
15 changes: 15 additions & 0 deletions
15
...built-ins/Temporal/Calendar/prototype/daysInMonth/throw-type-error-RequireInternalSlot.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.daysInMonth | ||
description: Temporal.Calendar.prototype.daysInMonth throws TypeError | ||
when the internal lot is not presented. | ||
info: | | ||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). | ||
features: [Temporal] | ||
---*/ | ||
let cal = new Temporal.Calendar("iso8601"); | ||
|
||
let badCal = { daysInMonth: cal.daysInMonth } | ||
assert.throws(TypeError, () => badCal.daysInMonth("2021-03-04"), | ||
"Throw TypeError if no internal slot"); |
14 changes: 14 additions & 0 deletions
14
test/built-ins/Temporal/Calendar/prototype/daysInWeek/date-time.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// 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.daysinweeks | ||
description: Temporal.Calendar.prototype.daysInWeek will take PlainDateTime and return 7. | ||
info: | | ||
4. Perform ? ToTemporalDate(temporalDateLike). | ||
5. Return 7𝔽. | ||
features: [Temporal] | ||
---*/ | ||
let cal = new Temporal.Calendar("iso8601"); | ||
|
||
let dt = new Temporal.PlainDateTime(1997, 8, 23, 5, 30, 13); | ||
assert.sameValue(cal.daysInWeek(dt), 7); |
13 changes: 13 additions & 0 deletions
13
test/built-ins/Temporal/Calendar/prototype/daysInWeek/date.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// 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.daysinweeks | ||
description: Temporal.Calendar.prototype.daysInWeek will take PlainDate and return 7. | ||
info: | | ||
5. Return 7𝔽. | ||
features: [Temporal] | ||
---*/ | ||
let cal = new Temporal.Calendar("iso8601"); | ||
|
||
let d = new Temporal.PlainDate(2021, 7, 15); | ||
assert.sameValue(cal.daysInWeek(d), 7); |
13 changes: 13 additions & 0 deletions
13
test/built-ins/Temporal/Calendar/prototype/daysInWeek/string.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// 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.daysinweeks | ||
description: Temporal.Calendar.prototype.daysInWeek will take valid ISO8601 string | ||
and return 7. | ||
info: | | ||
4. Perform ? ToTemporalDate(temporalDateLike). | ||
5. Return 7𝔽. | ||
features: [Temporal] | ||
---*/ | ||
let cal = new Temporal.Calendar("iso8601"); | ||
assert.sameValue(cal.daysInWeek("2019-03-18"), 7); |
14 changes: 14 additions & 0 deletions
14
test/built-ins/Temporal/Calendar/prototype/daysInWeek/throw-range-error-ToTemporalDate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// 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.daysInWeek | ||
description: Temporal.Calendar.prototype.daysInWeek throws RangeError on | ||
ToTemporalDate when temporalDateLike is invalid string. | ||
info: | | ||
4. Let temporalDate be ? ToTemporalDate(temporalDateLike). | ||
features: [Temporal] | ||
---*/ | ||
let cal = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(RangeError, () => cal.daysInWeek("invalid string"), | ||
"Throw RangeError if temporalDateLike is invalid"); |
15 changes: 15 additions & 0 deletions
15
.../built-ins/Temporal/Calendar/prototype/daysInWeek/throw-type-error-RequireInternalSlot.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.daysInWeek | ||
description: Temporal.Calendar.prototype.daysInWeek throws TypeError | ||
when the internal lot is not presented. | ||
info: | | ||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). | ||
features: [Temporal] | ||
---*/ | ||
let cal = new Temporal.Calendar("iso8601"); | ||
|
||
let badCal = { daysInWeek: cal.daysInWeek } | ||
assert.throws(TypeError, () => badCal.daysInWeek("2021-03-04"), | ||
"Throw TypeError if no internal slot"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
test/built-ins/Temporal/Calendar/prototype/daysInYear/throw-range-error-ToTemporalDate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.daysInYear | ||
description: Temporal.Calendar.prototype.daysInYear 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.daysInYear("invalid string"), | ||
"Throw RangeError if temporalDateLike is invalid"); |
Oops, something went wrong.