test262/test/built-ins/Temporal/PlainTime/from/argument-string-invalid.js
2022-02-16 09:39:30 -05:00

27 lines
707 B
JavaScript

// 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.plaintime.from
description: overflow property is extracted with ISO-invalid string argument.
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
---*/
const expected = [
"get overflow",
"get overflow.toString",
"call overflow.toString",
];
let actual = [];
const object = {
get overflow() {
actual.push("get overflow");
return TemporalHelpers.toPrimitiveObserver(actual, "constrain", "overflow");
}
};
assert.throws(RangeError, () => Temporal.PlainTime.from("24:60", object));
assert.compareArray(actual, expected);