mirror of https://github.com/tc39/test262.git
Test overflow 'reject' in PlainDate#{add,subtract}.
This commit is contained in:
parent
ef0b1507fc
commit
a042241ed2
|
@ -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" }));
|
|
@ -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…
Reference in New Issue