test262/test/built-ins/Temporal/Instant/compare/argument-string-with-offset-not-valid-epoch-nanoseconds.js
André Bargull a3040a5047 Import SpiderMonkey Temporal tests
Temporal tests written for the SpiderMonkey implementation. Mostly
covers edge cases around mathematical operations and regression tests
for reported spec bugs.
2022-07-19 11:30:43 -07:00

21 lines
539 B
JavaScript

// Copyright (C) 2022 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.instant.compare
description: >
Throws when argument at maximum representable date/time value with a negative offset.
features: [Temporal]
---*/
// Not a valid epoch nanoseconds value due to the offset.
var one = "+275760-09-13T00:00:00.000-12";
var two = {
toString() {
throw new Test262Error();
}
};
assert.throws(RangeError, () => Temporal.Instant.compare(one, two));