2021-09-29 21:48:22 +02:00
|
|
|
// 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.plainmonthday.from
|
|
|
|
description: Properties on an object passed to from() are accessed in the correct order
|
|
|
|
includes: [compareArray.js, temporalHelpers.js]
|
|
|
|
features: [Temporal]
|
|
|
|
---*/
|
|
|
|
|
|
|
|
const expected = [
|
2022-09-20 20:22:00 +02:00
|
|
|
"get fields.calendar",
|
|
|
|
"get fields.day",
|
|
|
|
"get fields.day.valueOf",
|
|
|
|
"call fields.day.valueOf",
|
|
|
|
"get fields.month",
|
|
|
|
"get fields.month.valueOf",
|
|
|
|
"call fields.month.valueOf",
|
|
|
|
"get fields.monthCode",
|
|
|
|
"get fields.monthCode.toString",
|
|
|
|
"call fields.monthCode.toString",
|
|
|
|
"get fields.year",
|
|
|
|
"get fields.year.valueOf",
|
|
|
|
"call fields.year.valueOf",
|
2021-09-29 21:48:22 +02:00
|
|
|
];
|
|
|
|
const actual = [];
|
2022-09-20 20:22:00 +02:00
|
|
|
const fields = TemporalHelpers.propertyBagObserver(actual, {
|
2021-09-29 21:48:22 +02:00
|
|
|
year: 1.7,
|
|
|
|
month: 1.7,
|
|
|
|
monthCode: "M01",
|
|
|
|
day: 1.7,
|
2022-09-20 20:22:00 +02:00
|
|
|
}, "fields");
|
|
|
|
const result = Temporal.PlainMonthDay.from(fields);
|
2021-09-29 21:48:22 +02:00
|
|
|
TemporalHelpers.assertPlainMonthDay(result, "M01", 1);
|
|
|
|
assert.sameValue(result.calendar.id, "iso8601", "calendar result");
|
|
|
|
assert.compareArray(actual, expected, "order of operations");
|