summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/with/options-undefined.js
blob: 02c8659e121c8d34db8995ab9d2940d86aa62c37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.plaintime.prototype.with
includes: [temporalHelpers.js]
description: Verify that undefined options are handled correctly.
features: [Temporal]
---*/

const time = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
const fields = { minute: 60 };

const explicit = time.with(fields, undefined);
TemporalHelpers.assertPlainTime(explicit, 12, 59, 56, 987, 654, 321, "explicit");

const implicit = time.with(fields);
TemporalHelpers.assertPlainTime(implicit, 12, 59, 56, 987, 654, 321, "implicit");

const lambda = time.with(fields, () => {});
TemporalHelpers.assertPlainTime(lambda, 12, 59, 56, 987, 654, 321, "lambda");

reportCompare(0, 0);