mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Declare variables to allow running in strict-mode
This commit is contained in:
parent
57b9f154a6
commit
42a9f69ab2
test/built-ins/Temporal
Calendar/prototype/monthDayFromFields
Duration/prototype/round
@ -29,7 +29,7 @@ const options = [
|
||||
];
|
||||
options.forEach((opt) => {
|
||||
const optionsDesc = opt && JSON.stringify(opt);
|
||||
result = cal.monthDayFromFields({ year: 2021, month: 7, day: 3 }, opt);
|
||||
let result = cal.monthDayFromFields({ year: 2021, month: 7, day: 3 }, opt);
|
||||
TemporalHelpers.assertPlainMonthDay(result, "M07", 3, `month 7, day 3, with year, options = ${optionsDesc}`);
|
||||
result = cal.monthDayFromFields({ year: 2021, month: 12, day: 31 }, opt);
|
||||
TemporalHelpers.assertPlainMonthDay(result, "M12", 31, `month 12, day 31, with year, options = ${optionsDesc}`);
|
||||
@ -40,7 +40,7 @@ options.forEach((opt) => {
|
||||
});
|
||||
|
||||
TemporalHelpers.ISOMonths.forEach(({ month, monthCode, daysInMonth }) => {
|
||||
result = cal.monthDayFromFields({ month, day: daysInMonth });
|
||||
let result = cal.monthDayFromFields({ month, day: daysInMonth });
|
||||
TemporalHelpers.assertPlainMonthDay(result, monthCode, daysInMonth, `month ${month}, day ${daysInMonth}`);
|
||||
|
||||
result = cal.monthDayFromFields({ monthCode, day: daysInMonth });
|
||||
|
@ -18,7 +18,7 @@ const tests = [ ["days", { days: day_duration }],
|
||||
["microseconds", { microseconds: day_duration * 24 * 60 * 60 * 1000 * 1000 }],
|
||||
["nanoseconds", { nanoseconds: day_duration * 24 * 60 * 60 * 1000 * 1000 * 1000 }]];
|
||||
|
||||
for ([unit, duration_desc] of tests)
|
||||
for (const [unit, duration_desc] of tests)
|
||||
TemporalHelpers.assertDuration(Temporal.Duration.from(duration_desc).round({ relativeTo: '2023-02-21', largestUnit: 'month' }),
|
||||
0, 3, 0, 11, 0, 0, 0, 0, 0, 0, `rounding from ${unit}`);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user