Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainMonthDay/refisoyear-undefined.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2021 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-temporal.plainmonthday
7 description: referenceISOYear argument defaults to 1972 if not given
8 features: [Temporal]
9 ---*/
10
11 const args = [5, 2, "iso8601"];
12
13 const dateExplicit = new Temporal.PlainMonthDay(...args, undefined);
14 const isoYearExplicit = Number(dateExplicit.toString({ calendarName: "always" }).slice(0, 4));
15 assert.sameValue(isoYearExplicit, 1972, "default referenceISOYear is 1972");
16
17 const dateImplicit = new Temporal.PlainMonthDay(...args);
18 const isoYearImplicit = Number(dateImplicit.toString({ calendarName: "always" }).slice(0, 4));
19 assert.sameValue(isoYearImplicit, 1972, "default referenceISOYear is 1972");
20
21 reportCompare(0, 0);