Skip to content

Commit b078965

Browse files
committed
Polyfill: Update reference code to reflect normative change
1 parent 9924aa4 commit b078965

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
@@ -3623,6 +3623,10 @@ export function GetDifferenceSettings(op, options, group, disallowed, fallbackSm
36233623
]);
36243624

36253625
let largestUnit = GetTemporalUnitValuedOption(options, 'largestUnit');
3626+
const roundingIncrement = GetRoundingIncrementOption(options);
3627+
let roundingMode = GetRoundingModeOption(options, 'trunc');
3628+
let smallestUnit = GetTemporalUnitValuedOption(options, 'smallestUnit');
3629+
36263630
ValidateTemporalUnitValue(largestUnit, group, ['auto']);
36273631
if (!largestUnit) largestUnit = 'auto';
36283632
if (Call(ArrayPrototypeIncludes, disallowed, [largestUnit])) {
@@ -3631,12 +3635,8 @@ export function GetDifferenceSettings(op, options, group, disallowed, fallbackSm
36313635
);
36323636
}
36333637

3634-
const roundingIncrement = GetRoundingIncrementOption(options);
3635-
3636-
let roundingMode = GetRoundingModeOption(options, 'trunc');
36373638
if (op === 'since') roundingMode = NegateRoundingMode(roundingMode);
36383639

3639-
let smallestUnit = GetTemporalUnitValuedOption(options, 'smallestUnit');
36403640
ValidateTemporalUnitValue(smallestUnit, group);
36413641
if (!smallestUnit) smallestUnit = fallbackSmallest;
36423642
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)