mirror of https://github.com/tc39/test262.git
Remove duplicate tests (#3222)
While working on adding the Temporal tests from tc39/proposal-temporal I noticed that these tests tested the same thing as each of the branding.js tests in the same directory. This removes the duplicate tests.
This commit is contained in:
parent
04ad519be9
commit
c7ca06acb2
test/built-ins/Temporal/Calendar/prototype
dateAdd
dateFromFields
dateUntil
day
dayOfWeek
dayOfYear
daysInMonth
daysInWeek
daysInYear
month
monthCode
year
|
@ -11,12 +11,14 @@ const dateAdd = Temporal.Calendar.prototype.dateAdd;
|
|||
|
||||
assert.sameValue(typeof dateAdd, "function");
|
||||
|
||||
assert.throws(TypeError, () => dateAdd.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dateAdd.call(null), "null");
|
||||
assert.throws(TypeError, () => dateAdd.call(true), "true");
|
||||
assert.throws(TypeError, () => dateAdd.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dateAdd.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dateAdd.call(1), "1");
|
||||
assert.throws(TypeError, () => dateAdd.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dateAdd.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dateAdd.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
||||
const args = [new Temporal.PlainDate(2000, 1, 1), new Temporal.Duration(1)];
|
||||
|
||||
assert.throws(TypeError, () => dateAdd.apply(undefined, args), "undefined");
|
||||
assert.throws(TypeError, () => dateAdd.apply(null, args), "null");
|
||||
assert.throws(TypeError, () => dateAdd.apply(true, args), "true");
|
||||
assert.throws(TypeError, () => dateAdd.apply("", args), "empty string");
|
||||
assert.throws(TypeError, () => dateAdd.apply(Symbol(), args), "symbol");
|
||||
assert.throws(TypeError, () => dateAdd.apply(1, args), "1");
|
||||
assert.throws(TypeError, () => dateAdd.apply({}, args), "plain object");
|
||||
assert.throws(TypeError, () => dateAdd.apply(Temporal.Calendar, args), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dateAdd.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype");
|
||||
|
|
|
@ -1,17 +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.dateadd
|
||||
description: Temporal.Calendar.prototype.dateAdd should throw if calendar does not have required internal slot
|
||||
info: |
|
||||
1. Let calendar be the this value.
|
||||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
features: [Temporal, arrow-function]
|
||||
---*/
|
||||
let cal = new Temporal.Calendar("iso8601");
|
||||
|
||||
let badCal = { dateAdd: cal.dateAdd };
|
||||
assert.throws(TypeError,
|
||||
() => badCal.dateAdd("2020-02-29", new Temporal.Duration(1)),
|
||||
'badCal.dateAdd("2020-02-29", new Temporal.Duration(1)) throws a TypeError exception');
|
|
@ -11,12 +11,14 @@ const dateFromFields = Temporal.Calendar.prototype.dateFromFields;
|
|||
|
||||
assert.sameValue(typeof dateFromFields, "function");
|
||||
|
||||
assert.throws(TypeError, () => dateFromFields.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dateFromFields.call(null), "null");
|
||||
assert.throws(TypeError, () => dateFromFields.call(true), "true");
|
||||
assert.throws(TypeError, () => dateFromFields.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dateFromFields.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dateFromFields.call(1), "1");
|
||||
assert.throws(TypeError, () => dateFromFields.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dateFromFields.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dateFromFields.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
||||
const args = [{ year: 2000, month: 1, day: 1 }];
|
||||
|
||||
assert.throws(TypeError, () => dateFromFields.apply(undefined, args), "undefined");
|
||||
assert.throws(TypeError, () => dateFromFields.apply(null, args), "null");
|
||||
assert.throws(TypeError, () => dateFromFields.apply(true, args), "true");
|
||||
assert.throws(TypeError, () => dateFromFields.apply("", args), "empty string");
|
||||
assert.throws(TypeError, () => dateFromFields.apply(Symbol(), args), "symbol");
|
||||
assert.throws(TypeError, () => dateFromFields.apply(1, args), "1");
|
||||
assert.throws(TypeError, () => dateFromFields.apply({}, args), "plain object");
|
||||
assert.throws(TypeError, () => dateFromFields.apply(Temporal.Calendar, args), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dateFromFields.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype");
|
||||
|
|
|
@ -1,15 +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.datefromfields
|
||||
description: Temporal.Calendar.prototype.dateFromFields should throw TypeError while calendar has no [[InitializedTemporalCalendar]]
|
||||
info: |
|
||||
1. Let calendar be the this value.
|
||||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
features: [Temporal, arrow-function]
|
||||
---*/
|
||||
let cal = new Temporal.Calendar("iso8601")
|
||||
let badCal = {dateFromFields: cal.dateFromFields};
|
||||
|
||||
assert.throws(TypeError, () => badCal.dateFromFields({}),
|
||||
'badCal.dateFromFields({}) throws a TypeError exception');
|
|
@ -11,12 +11,14 @@ const dateUntil = Temporal.Calendar.prototype.dateUntil;
|
|||
|
||||
assert.sameValue(typeof dateUntil, "function");
|
||||
|
||||
assert.throws(TypeError, () => dateUntil.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dateUntil.call(null), "null");
|
||||
assert.throws(TypeError, () => dateUntil.call(true), "true");
|
||||
assert.throws(TypeError, () => dateUntil.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dateUntil.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dateUntil.call(1), "1");
|
||||
assert.throws(TypeError, () => dateUntil.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dateUntil.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dateUntil.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
||||
const args = [new Temporal.PlainDate(2021, 7, 16), new Temporal.PlainDate(2021, 7, 17)];
|
||||
|
||||
assert.throws(TypeError, () => dateUntil.apply(undefined, args), "undefined");
|
||||
assert.throws(TypeError, () => dateUntil.apply(null, args), "null");
|
||||
assert.throws(TypeError, () => dateUntil.apply(true, args), "true");
|
||||
assert.throws(TypeError, () => dateUntil.apply("", args), "empty string");
|
||||
assert.throws(TypeError, () => dateUntil.apply(Symbol(), args), "symbol");
|
||||
assert.throws(TypeError, () => dateUntil.apply(1, args), "1");
|
||||
assert.throws(TypeError, () => dateUntil.apply({}, args), "plain object");
|
||||
assert.throws(TypeError, () => dateUntil.apply(Temporal.Calendar, args), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dateUntil.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype");
|
||||
|
|
|
@ -1,16 +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.dateuntil
|
||||
description: Temporal.Calendar.prototype.dateUntil throw TypeError on RequireInternalSlot
|
||||
info: |
|
||||
1. Let calendar be the this value.
|
||||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
features: [Temporal, arrow-function]
|
||||
---*/
|
||||
let cal = new Temporal.Calendar("iso8601");
|
||||
let badCal = { dateUntil: cal.dateUntil };
|
||||
|
||||
assert.throws(TypeError, () => badCal.dateUntil("2021-07-16", "2021-07-17"),
|
||||
'badCal.dateUntil("2021-07-16", "2021-07-17") throws a TypeError exception');
|
|
@ -11,12 +11,14 @@ const day = Temporal.Calendar.prototype.day;
|
|||
|
||||
assert.sameValue(typeof day, "function");
|
||||
|
||||
assert.throws(TypeError, () => day.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => day.call(null), "null");
|
||||
assert.throws(TypeError, () => day.call(true), "true");
|
||||
assert.throws(TypeError, () => day.call(""), "empty string");
|
||||
assert.throws(TypeError, () => day.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => day.call(1), "1");
|
||||
assert.throws(TypeError, () => day.call({}), "plain object");
|
||||
assert.throws(TypeError, () => day.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => day.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
||||
const args = [new Temporal.PlainDate(2000, 1, 1)];
|
||||
|
||||
assert.throws(TypeError, () => day.apply(undefined, args), "undefined");
|
||||
assert.throws(TypeError, () => day.apply(null, args), "null");
|
||||
assert.throws(TypeError, () => day.apply(true, args), "true");
|
||||
assert.throws(TypeError, () => day.apply("", args), "empty string");
|
||||
assert.throws(TypeError, () => day.apply(Symbol(), args), "symbol");
|
||||
assert.throws(TypeError, () => day.apply(1, args), "1");
|
||||
assert.throws(TypeError, () => day.apply({}, args), "plain object");
|
||||
assert.throws(TypeError, () => day.apply(Temporal.Calendar, args), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => day.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype");
|
||||
|
|
|
@ -1,15 +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.day
|
||||
description: Temporal.Calendar.prototype.day throws TypeError on RequireInternalSlot if object has no internal slot.
|
||||
info: |
|
||||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
features: [Temporal, arrow-function]
|
||||
---*/
|
||||
let cal = new Temporal.Calendar("iso8601");
|
||||
|
||||
let badCal = { day: cal.day }
|
||||
assert.throws(TypeError, () => badCal.day("2021-03-04"),
|
||||
'badCal.day("2021-03-04") throws a TypeError exception');
|
|
@ -11,12 +11,14 @@ const dayOfWeek = Temporal.Calendar.prototype.dayOfWeek;
|
|||
|
||||
assert.sameValue(typeof dayOfWeek, "function");
|
||||
|
||||
assert.throws(TypeError, () => dayOfWeek.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(null), "null");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(true), "true");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(1), "1");
|
||||
assert.throws(TypeError, () => dayOfWeek.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dayOfWeek.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
||||
const args = [new Temporal.PlainDate(2000, 1, 1)];
|
||||
|
||||
assert.throws(TypeError, () => dayOfWeek.apply(undefined, args), "undefined");
|
||||
assert.throws(TypeError, () => dayOfWeek.apply(null, args), "null");
|
||||
assert.throws(TypeError, () => dayOfWeek.apply(true, args), "true");
|
||||
assert.throws(TypeError, () => dayOfWeek.apply("", args), "empty string");
|
||||
assert.throws(TypeError, () => dayOfWeek.apply(Symbol(), args), "symbol");
|
||||
assert.throws(TypeError, () => dayOfWeek.apply(1, args), "1");
|
||||
assert.throws(TypeError, () => dayOfWeek.apply({}, args), "plain object");
|
||||
assert.throws(TypeError, () => dayOfWeek.apply(Temporal.Calendar, args), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dayOfWeek.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype");
|
||||
|
|
|
@ -1,16 +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.dayOfWeek
|
||||
description: >
|
||||
Temporal.Calendar.prototype.dayOfWeek throws TypeError
|
||||
when the internal lot is not presented.
|
||||
info: |
|
||||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
features: [Temporal, arrow-function]
|
||||
---*/
|
||||
let cal = new Temporal.Calendar("iso8601");
|
||||
|
||||
let badCal = { dayOfWeek: cal.dayOfWeek }
|
||||
assert.throws(TypeError, () => badCal.dayOfWeek("2021-03-04"),
|
||||
'badCal.dayOfWeek("2021-03-04") throws a TypeError exception');
|
|
@ -11,12 +11,14 @@ const dayOfYear = Temporal.Calendar.prototype.dayOfYear;
|
|||
|
||||
assert.sameValue(typeof dayOfYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => dayOfYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => dayOfYear.call(null), "null");
|
||||
assert.throws(TypeError, () => dayOfYear.call(true), "true");
|
||||
assert.throws(TypeError, () => dayOfYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => dayOfYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => dayOfYear.call(1), "1");
|
||||
assert.throws(TypeError, () => dayOfYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => dayOfYear.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dayOfYear.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
||||
const args = [new Temporal.PlainDate(2000, 1, 1)];
|
||||
|
||||
assert.throws(TypeError, () => dayOfYear.apply(undefined, args), "undefined");
|
||||
assert.throws(TypeError, () => dayOfYear.apply(null, args), "null");
|
||||
assert.throws(TypeError, () => dayOfYear.apply(true, args), "true");
|
||||
assert.throws(TypeError, () => dayOfYear.apply("", args), "empty string");
|
||||
assert.throws(TypeError, () => dayOfYear.apply(Symbol(), args), "symbol");
|
||||
assert.throws(TypeError, () => dayOfYear.apply(1, args), "1");
|
||||
assert.throws(TypeError, () => dayOfYear.apply({}, args), "plain object");
|
||||
assert.throws(TypeError, () => dayOfYear.apply(Temporal.Calendar, args), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => dayOfYear.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype");
|
||||
|
|
|
@ -1,16 +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.dayOfYear
|
||||
description: >
|
||||
Temporal.Calendar.prototype.dayOfYear throws TypeError
|
||||
when the internal lot is not presented.
|
||||
info: |
|
||||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
features: [Temporal, arrow-function]
|
||||
---*/
|
||||
let cal = new Temporal.Calendar("iso8601");
|
||||
|
||||
let badCal = { dayOfYear: cal.dayOfYear }
|
||||
assert.throws(TypeError, () => badCal.dayOfYear("2021-03-04"),
|
||||
'badCal.dayOfYear("2021-03-04") throws a TypeError exception');
|
|
@ -11,12 +11,14 @@ const daysInMonth = Temporal.Calendar.prototype.daysInMonth;
|
|||
|
||||
assert.sameValue(typeof daysInMonth, "function");
|
||||
|
||||
assert.throws(TypeError, () => daysInMonth.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => daysInMonth.call(null), "null");
|
||||
assert.throws(TypeError, () => daysInMonth.call(true), "true");
|
||||
assert.throws(TypeError, () => daysInMonth.call(""), "empty string");
|
||||
assert.throws(TypeError, () => daysInMonth.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => daysInMonth.call(1), "1");
|
||||
assert.throws(TypeError, () => daysInMonth.call({}), "plain object");
|
||||
assert.throws(TypeError, () => daysInMonth.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => daysInMonth.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
||||
const args = [new Temporal.PlainDate(2000, 1, 1)];
|
||||
|
||||
assert.throws(TypeError, () => daysInMonth.apply(undefined, args), "undefined");
|
||||
assert.throws(TypeError, () => daysInMonth.apply(null, args), "null");
|
||||
assert.throws(TypeError, () => daysInMonth.apply(true, args), "true");
|
||||
assert.throws(TypeError, () => daysInMonth.apply("", args), "empty string");
|
||||
assert.throws(TypeError, () => daysInMonth.apply(Symbol(), args), "symbol");
|
||||
assert.throws(TypeError, () => daysInMonth.apply(1, args), "1");
|
||||
assert.throws(TypeError, () => daysInMonth.apply({}, args), "plain object");
|
||||
assert.throws(TypeError, () => daysInMonth.apply(Temporal.Calendar, args), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => daysInMonth.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype");
|
||||
|
|
|
@ -1,16 +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.daysInMonth
|
||||
description: >
|
||||
Temporal.Calendar.prototype.daysInMonth throws TypeError
|
||||
when the internal lot is not presented.
|
||||
info: |
|
||||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
features: [Temporal, arrow-function]
|
||||
---*/
|
||||
let cal = new Temporal.Calendar("iso8601");
|
||||
|
||||
let badCal = { daysInMonth: cal.daysInMonth }
|
||||
assert.throws(TypeError, () => badCal.daysInMonth("2021-03-04"),
|
||||
'badCal.daysInMonth("2021-03-04") throws a TypeError exception');
|
|
@ -11,12 +11,14 @@ const daysInWeek = Temporal.Calendar.prototype.daysInWeek;
|
|||
|
||||
assert.sameValue(typeof daysInWeek, "function");
|
||||
|
||||
assert.throws(TypeError, () => daysInWeek.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => daysInWeek.call(null), "null");
|
||||
assert.throws(TypeError, () => daysInWeek.call(true), "true");
|
||||
assert.throws(TypeError, () => daysInWeek.call(""), "empty string");
|
||||
assert.throws(TypeError, () => daysInWeek.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => daysInWeek.call(1), "1");
|
||||
assert.throws(TypeError, () => daysInWeek.call({}), "plain object");
|
||||
assert.throws(TypeError, () => daysInWeek.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => daysInWeek.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
||||
const args = [new Temporal.PlainDate(2000, 1, 1)];
|
||||
|
||||
assert.throws(TypeError, () => daysInWeek.apply(undefined, args), "undefined");
|
||||
assert.throws(TypeError, () => daysInWeek.apply(null, args), "null");
|
||||
assert.throws(TypeError, () => daysInWeek.apply(true, args), "true");
|
||||
assert.throws(TypeError, () => daysInWeek.apply("", args), "empty string");
|
||||
assert.throws(TypeError, () => daysInWeek.apply(Symbol(), args), "symbol");
|
||||
assert.throws(TypeError, () => daysInWeek.apply(1, args), "1");
|
||||
assert.throws(TypeError, () => daysInWeek.apply({}, args), "plain object");
|
||||
assert.throws(TypeError, () => daysInWeek.apply(Temporal.Calendar, args), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => daysInWeek.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype");
|
||||
|
|
|
@ -1,16 +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.daysInWeek
|
||||
description: >
|
||||
Temporal.Calendar.prototype.daysInWeek throws TypeError
|
||||
when the internal lot is not presented.
|
||||
info: |
|
||||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
features: [Temporal, arrow-function]
|
||||
---*/
|
||||
let cal = new Temporal.Calendar("iso8601");
|
||||
|
||||
let badCal = { daysInWeek: cal.daysInWeek }
|
||||
assert.throws(TypeError, () => badCal.daysInWeek("2021-03-04"),
|
||||
'badCal.daysInWeek("2021-03-04") throws a TypeError exception');
|
|
@ -11,12 +11,14 @@ const daysInYear = Temporal.Calendar.prototype.daysInYear;
|
|||
|
||||
assert.sameValue(typeof daysInYear, "function");
|
||||
|
||||
assert.throws(TypeError, () => daysInYear.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => daysInYear.call(null), "null");
|
||||
assert.throws(TypeError, () => daysInYear.call(true), "true");
|
||||
assert.throws(TypeError, () => daysInYear.call(""), "empty string");
|
||||
assert.throws(TypeError, () => daysInYear.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => daysInYear.call(1), "1");
|
||||
assert.throws(TypeError, () => daysInYear.call({}), "plain object");
|
||||
assert.throws(TypeError, () => daysInYear.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => daysInYear.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
||||
const args = [new Temporal.PlainDate(2000, 1, 1)];
|
||||
|
||||
assert.throws(TypeError, () => daysInYear.apply(undefined, args), "undefined");
|
||||
assert.throws(TypeError, () => daysInYear.apply(null, args), "null");
|
||||
assert.throws(TypeError, () => daysInYear.apply(true, args), "true");
|
||||
assert.throws(TypeError, () => daysInYear.apply("", args), "empty string");
|
||||
assert.throws(TypeError, () => daysInYear.apply(Symbol(), args), "symbol");
|
||||
assert.throws(TypeError, () => daysInYear.apply(1, args), "1");
|
||||
assert.throws(TypeError, () => daysInYear.apply({}, args), "plain object");
|
||||
assert.throws(TypeError, () => daysInYear.apply(Temporal.Calendar, args), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => daysInYear.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype");
|
||||
|
|
|
@ -1,16 +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.daysInYear
|
||||
description: >
|
||||
Temporal.Calendar.prototype.daysInYear throws TypeError
|
||||
when the internal lot is not presented.
|
||||
info: |
|
||||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
features: [Temporal, arrow-function]
|
||||
---*/
|
||||
let cal = new Temporal.Calendar("iso8601");
|
||||
|
||||
let badCal = { daysInYear: cal.daysInYear }
|
||||
assert.throws(TypeError, () => badCal.daysInYear("2021-03-04"),
|
||||
'badCal.daysInYear("2021-03-04") throws a TypeError exception');
|
|
@ -11,12 +11,14 @@ const month = Temporal.Calendar.prototype.month;
|
|||
|
||||
assert.sameValue(typeof month, "function");
|
||||
|
||||
assert.throws(TypeError, () => month.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => month.call(null), "null");
|
||||
assert.throws(TypeError, () => month.call(true), "true");
|
||||
assert.throws(TypeError, () => month.call(""), "empty string");
|
||||
assert.throws(TypeError, () => month.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => month.call(1), "1");
|
||||
assert.throws(TypeError, () => month.call({}), "plain object");
|
||||
assert.throws(TypeError, () => month.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => month.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
||||
const args = [new Temporal.PlainDate(2000, 1, 1)];
|
||||
|
||||
assert.throws(TypeError, () => month.apply(undefined, args), "undefined");
|
||||
assert.throws(TypeError, () => month.apply(null, args), "null");
|
||||
assert.throws(TypeError, () => month.apply(true, args), "true");
|
||||
assert.throws(TypeError, () => month.apply("", args), "empty string");
|
||||
assert.throws(TypeError, () => month.apply(Symbol(), args), "symbol");
|
||||
assert.throws(TypeError, () => month.apply(1, args), "1");
|
||||
assert.throws(TypeError, () => month.apply({}, args), "plain object");
|
||||
assert.throws(TypeError, () => month.apply(Temporal.Calendar, args), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => month.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype");
|
||||
|
|
|
@ -1,15 +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 throws TypeError on RequireInternalSlot if object has no internal slot.
|
||||
info: |
|
||||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
features: [Temporal, arrow-function]
|
||||
---*/
|
||||
let cal = new Temporal.Calendar("iso8601");
|
||||
|
||||
let badCal = { month: cal.month }
|
||||
assert.throws(TypeError, () => badCal.month("2021-03-04"),
|
||||
'badCal.month("2021-03-04") throws a TypeError exception');
|
|
@ -11,12 +11,14 @@ const monthCode = Temporal.Calendar.prototype.monthCode;
|
|||
|
||||
assert.sameValue(typeof monthCode, "function");
|
||||
|
||||
assert.throws(TypeError, () => monthCode.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => monthCode.call(null), "null");
|
||||
assert.throws(TypeError, () => monthCode.call(true), "true");
|
||||
assert.throws(TypeError, () => monthCode.call(""), "empty string");
|
||||
assert.throws(TypeError, () => monthCode.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => monthCode.call(1), "1");
|
||||
assert.throws(TypeError, () => monthCode.call({}), "plain object");
|
||||
assert.throws(TypeError, () => monthCode.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => monthCode.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
||||
const args = [new Temporal.PlainDate(2000, 1, 1)];
|
||||
|
||||
assert.throws(TypeError, () => monthCode.apply(undefined, args), "undefined");
|
||||
assert.throws(TypeError, () => monthCode.apply(null, args), "null");
|
||||
assert.throws(TypeError, () => monthCode.apply(true, args), "true");
|
||||
assert.throws(TypeError, () => monthCode.apply("", args), "empty string");
|
||||
assert.throws(TypeError, () => monthCode.apply(Symbol(), args), "symbol");
|
||||
assert.throws(TypeError, () => monthCode.apply(1, args), "1");
|
||||
assert.throws(TypeError, () => monthCode.apply({}, args), "plain object");
|
||||
assert.throws(TypeError, () => monthCode.apply(Temporal.Calendar, args), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => monthCode.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype");
|
||||
|
|
|
@ -1,15 +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 throws TypeError on RequireInternalSlot if object has no internal slot.
|
||||
info: |
|
||||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
features: [Temporal, arrow-function]
|
||||
---*/
|
||||
let cal = new Temporal.Calendar("iso8601");
|
||||
|
||||
let badCal = { monthCode: cal.monthCode}
|
||||
assert.throws(TypeError, () => badCal.monthCode("2021-03-04"),
|
||||
'badCal.monthCode("2021-03-04") throws a TypeError exception');
|
|
@ -11,12 +11,14 @@ const year = Temporal.Calendar.prototype.year;
|
|||
|
||||
assert.sameValue(typeof year, "function");
|
||||
|
||||
assert.throws(TypeError, () => year.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => year.call(null), "null");
|
||||
assert.throws(TypeError, () => year.call(true), "true");
|
||||
assert.throws(TypeError, () => year.call(""), "empty string");
|
||||
assert.throws(TypeError, () => year.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => year.call(1), "1");
|
||||
assert.throws(TypeError, () => year.call({}), "plain object");
|
||||
assert.throws(TypeError, () => year.call(Temporal.Calendar), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => year.call(Temporal.Calendar.prototype), "Temporal.Calendar.prototype");
|
||||
const args = [new Temporal.PlainDate(2000, 1, 1)];
|
||||
|
||||
assert.throws(TypeError, () => year.apply(undefined, args), "undefined");
|
||||
assert.throws(TypeError, () => year.apply(null, args), "null");
|
||||
assert.throws(TypeError, () => year.apply(true, args), "true");
|
||||
assert.throws(TypeError, () => year.apply("", args), "empty string");
|
||||
assert.throws(TypeError, () => year.apply(Symbol(), args), "symbol");
|
||||
assert.throws(TypeError, () => year.apply(1, args), "1");
|
||||
assert.throws(TypeError, () => year.apply({}, args), "plain object");
|
||||
assert.throws(TypeError, () => year.apply(Temporal.Calendar, args), "Temporal.Calendar");
|
||||
assert.throws(TypeError, () => year.apply(Temporal.Calendar.prototype, args), "Temporal.Calendar.prototype");
|
||||
|
|
|
@ -1,17 +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.year
|
||||
description: >
|
||||
Temporal.Calendar.prototype.year throws TypeError on
|
||||
RequireInternalSlot if object has no internal slot.
|
||||
info: |
|
||||
2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
features: [Temporal, arrow-function]
|
||||
---*/
|
||||
let cal = new Temporal.Calendar("iso8601");
|
||||
|
||||
let badCal = { year: cal.year }
|
||||
assert.throws(TypeError, () => badCal.year("2021-03-04"),
|
||||
'badCal.year("2021-03-04") throws a TypeError exception');
|
Loading…
Reference in New Issue