mirror of
https://github.com/tc39/test262.git
synced 2025-09-23 01:58:28 +02:00
Has several effects on existing tests: - Remove PlainTime from various tests that extract a Temporal.Calendar instance from another Temporal object. - Remove Temporal.PlainTime.prototype.calendar property. - Remove calendar property from object returned from Temporal.PlainTime.prototype.getISOFields(). - Ignore calendar annotation when converting ISO string to PlainTime. Normative PR: https://github.com/tc39/proposal-temporal/pull/2482
53 lines
1.4 KiB
JavaScript
53 lines
1.4 KiB
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.plaintime.from
|
|
description: Properties on an object passed to from() are accessed in the correct order
|
|
includes: [compareArray.js, temporalHelpers.js]
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
const expected = [
|
|
"get options.overflow",
|
|
"get options.overflow.toString",
|
|
"call options.overflow.toString",
|
|
// ToTemporalTimeRecord
|
|
"get fields.hour",
|
|
"get fields.hour.valueOf",
|
|
"call fields.hour.valueOf",
|
|
"get fields.microsecond",
|
|
"get fields.microsecond.valueOf",
|
|
"call fields.microsecond.valueOf",
|
|
"get fields.millisecond",
|
|
"get fields.millisecond.valueOf",
|
|
"call fields.millisecond.valueOf",
|
|
"get fields.minute",
|
|
"get fields.minute.valueOf",
|
|
"call fields.minute.valueOf",
|
|
"get fields.nanosecond",
|
|
"get fields.nanosecond.valueOf",
|
|
"call fields.nanosecond.valueOf",
|
|
"get fields.second",
|
|
"get fields.second.valueOf",
|
|
"call fields.second.valueOf",
|
|
];
|
|
const actual = [];
|
|
|
|
const fields = TemporalHelpers.propertyBagObserver(actual, {
|
|
hour: 1.7,
|
|
minute: 1.7,
|
|
second: 1.7,
|
|
millisecond: 1.7,
|
|
microsecond: 1.7,
|
|
nanosecond: 1.7,
|
|
calendar: "iso8601",
|
|
}, "fields");
|
|
|
|
const options = TemporalHelpers.propertyBagObserver(actual, {
|
|
overflow: "constrain",
|
|
}, "options");
|
|
|
|
const result = Temporal.PlainTime.from(fields, options);
|
|
assert.compareArray(actual, expected, "order of operations");
|