test262/test/built-ins/Temporal/PlainDate/compare/calendar-datefromfields-called-with-options-undefined.js
Philip Chimento ac19506a01 Add tests ensuring that observable calls are made with options === undefined
Where possible, observable calls originating from within Temporal, that
require an options argument, should pass `undefined` as that options
argument, rather than `{}` or `Object.create(null)`.

See tc39/proposal-temporal#1685.
2022-04-04 16:24:17 -04:00

16 lines
614 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.plaindate.prototype.compare
description: >
Calendar.dateFromFields method is called with undefined as the options value
when call originates internally
includes: [temporalHelpers.js]
features: [Temporal]
---*/
const calendar = TemporalHelpers.calendarFromFieldsUndefinedOptions();
Temporal.PlainDate.compare({ year: 2000, month: 5, day: 2, calendar }, { year: 2000, month: 5, day: 3, calendar });
assert.sameValue(calendar.dateFromFieldsCallCount, 2);