Skip to content

Commit f60035a

Browse files
committed
Polyfill: Update reference code to reflect normative change
1 parent e28665a commit f60035a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

polyfill/lib/ecmascript.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3636,6 +3636,10 @@ export function GetDifferenceSettings(op, options, group, disallowed, fallbackSm
36363636
]);
36373637

36383638
let largestUnit = GetTemporalUnitValuedOption(options, 'largestUnit');
3639+
const roundingIncrement = GetRoundingIncrementOption(options);
3640+
let roundingMode = GetRoundingModeOption(options, 'trunc');
3641+
let smallestUnit = GetTemporalUnitValuedOption(options, 'smallestUnit');
3642+
36393643
ValidateTemporalUnitValue(largestUnit, group, ['auto']);
36403644
if (!largestUnit) largestUnit = 'auto';
36413645
if (Call(ArrayPrototypeIncludes, disallowed, [largestUnit])) {
@@ -3644,12 +3648,8 @@ export function GetDifferenceSettings(op, options, group, disallowed, fallbackSm
36443648
);
36453649
}
36463650

3647-
const roundingIncrement = GetRoundingIncrementOption(options);
3648-
3649-
let roundingMode = GetRoundingModeOption(options, 'trunc');
36503651
if (op === 'since') roundingMode = NegateRoundingMode(roundingMode);
36513652

3652-
let smallestUnit = GetTemporalUnitValuedOption(options, 'smallestUnit');
36533653
ValidateTemporalUnitValue(smallestUnit, group);
36543654
if (!smallestUnit) smallestUnit = fallbackSmallest;
36553655
if (Call(ArrayPrototypeIncludes, disallowed, [smallestUnit])) {

polyfill/lib/instant.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ export class Instant {
109109
const digits = ES.GetTemporalFractionalSecondDigitsOption(resolvedOptions);
110110
const roundingMode = ES.GetRoundingModeOption(resolvedOptions, 'trunc');
111111
const smallestUnit = ES.GetTemporalUnitValuedOption(resolvedOptions, 'smallestUnit');
112+
let timeZone = resolvedOptions.timeZone;
112113
ES.ValidateTemporalUnitValue(smallestUnit, 'time');
113114
if (smallestUnit === 'hour') throw new RangeErrorCtor('smallestUnit must be a time unit other than "hour"');
114-
let timeZone = resolvedOptions.timeZone;
115115
if (timeZone !== undefined) timeZone = ES.ToTemporalTimeZoneIdentifier(timeZone);
116116
const { precision, unit, increment } = ES.ToSecondsStringPrecisionRecord(smallestUnit, digits);
117117
const ns = GetSlot(this, EPOCHNANOSECONDS);

polyfill/lib/zoneddatetime.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@ export class ZonedDateTime {
349349
const showOffset = ES.GetTemporalShowOffsetOption(resolvedOptions);
350350
const roundingMode = ES.GetRoundingModeOption(resolvedOptions, 'trunc');
351351
const smallestUnit = ES.GetTemporalUnitValuedOption(resolvedOptions, 'smallestUnit');
352+
const showTimeZone = ES.GetTemporalShowTimeZoneNameOption(resolvedOptions);
352353
ES.ValidateTemporalUnitValue(smallestUnit, 'time');
353354
if (smallestUnit === 'hour') throw new RangeErrorCtor('smallestUnit must be a time unit other than "hour"');
354-
const showTimeZone = ES.GetTemporalShowTimeZoneNameOption(resolvedOptions);
355355
const { precision, unit, increment } = ES.ToSecondsStringPrecisionRecord(smallestUnit, digits);
356356
return ES.TemporalZonedDateTimeToString(this, precision, showCalendar, showTimeZone, showOffset, {
357357
unit,

0 commit comments

Comments
 (0)