mirror of
https://github.com/tc39/test262.git
synced 2025-08-18 08:28:27 +02:00
Edits Temporal tests to account for changes in https://github.com/tc39/proposal-temporal/pull/2574. This PR stops coercing non-string primitive inputs to strings in Temporal methods, to avoid cases where numbers are coerced to syntactically valid but often unexpected string results.
16 lines
723 B
JavaScript
16 lines
723 B
JavaScript
// Copyright (C) 2020 Igalia, S.L. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-temporal.duration.from
|
|
description: Appropriate error thrown if primitive input cannot convert to a valid string
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
assert.throws(TypeError, () => Temporal.Duration.from(undefined), "undefined");
|
|
assert.throws(TypeError, () => Temporal.Duration.from(null), "null");
|
|
assert.throws(TypeError, () => Temporal.Duration.from(true), "boolean");
|
|
assert.throws(TypeError, () => Temporal.Duration.from(Symbol()), "Symbol");
|
|
assert.throws(TypeError, () => Temporal.Duration.from(5), "number");
|
|
assert.throws(TypeError, () => Temporal.Duration.from(5n), "bigint");
|