mirror of
https://github.com/tc39/test262.git
synced 2025-07-21 13:04:39 +02:00
Test overflow 'reject' in PlainDate#{add,subtract}.
This commit is contained in:
parent
ef0b1507fc
commit
a042241ed2
11
test/built-ins/Temporal/PlainDate/prototype/add/overflow-reject.js
vendored
Normal file
11
test/built-ins/Temporal/PlainDate/prototype/add/overflow-reject.js
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.add
|
||||
description: Throws with overflow reject
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const jan31 = Temporal.PlainDate.from("2020-01-31");
|
||||
assert.throws(RangeError, () => jan31.add({ months: 1 }, { overflow: "reject" }));
|
11
test/built-ins/Temporal/PlainDate/prototype/subtract/overflow-reject.js
vendored
Normal file
11
test/built-ins/Temporal/PlainDate/prototype/subtract/overflow-reject.js
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.subtract
|
||||
description: Throws with overflow reject
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const mar31 = Temporal.PlainDate.from("2020-03-31");
|
||||
assert.throws(RangeError, () => mar31.subtract({ months: 1 }, { overflow: "reject" }));
|
Loading…
x
Reference in New Issue
Block a user