diff --git a/packages/temporal-polyfill/src/internal/isoFormat.ts b/packages/temporal-polyfill/src/internal/isoFormat.ts index 19a0b9bb..c5ae0872 100644 --- a/packages/temporal-polyfill/src/internal/isoFormat.ts +++ b/packages/temporal-polyfill/src/internal/isoFormat.ts @@ -89,12 +89,19 @@ export function formatZonedDateTimeIso( zonedDateTimeSlots0: ZonedDateTimeSlots, options?: ZonedDateTimeDisplayOptions, ): string { + const [a, b, c, d, e, f] = refineZonedDateTimeDisplayOptions(options) return formatZonedEpochNanoIso( getTimeZoneOps, zonedDateTimeSlots0.calendar, zonedDateTimeSlots0.timeZone, zonedDateTimeSlots0.epochNanoseconds, - ...refineZonedDateTimeDisplayOptions(options), + // workaround for https://github.com/swc-project/swc/issues/8806 + a, + b, + c, + d, + e, + f, ) } @@ -102,10 +109,15 @@ export function formatPlainDateTimeIso( plainDateTimeSlots0: PlainDateTimeSlots, options?: DateTimeDisplayOptions, ): string { + const [a, b, c, d] = refineDateTimeDisplayOptions(options) return formatDateTimeIso( plainDateTimeSlots0.calendar, plainDateTimeSlots0, - ...refineDateTimeDisplayOptions(options), + // workaround for https://github.com/swc-project/swc/issues/8806 + a, + b, + c, + d, ) } @@ -148,7 +160,14 @@ export function formatPlainTimeIso( slots: PlainTimeSlots, options?: TimeDisplayOptions, ): string { - return formatTimeIso(slots, ...refineTimeDisplayOptions(options)) + const [a, b, c] = refineTimeDisplayOptions(options) + return formatTimeIso( + slots, + // workaround for https://github.com/swc-project/swc/issues/8806 + a, + b, + c, + ) } export function formatDurationIso( diff --git a/packages/temporal-polyfill/src/internal/round.ts b/packages/temporal-polyfill/src/internal/round.ts index a5f9a727..d050f7d7 100644 --- a/packages/temporal-polyfill/src/internal/round.ts +++ b/packages/temporal-polyfill/src/internal/round.ts @@ -168,14 +168,13 @@ export function roundPlainTime( slots: PlainTimeSlots, options: TimeUnitName | RoundingOptions, ): PlainTimeSlots { - const roundedIsoFields = roundTime( - slots, - ...(refineRoundingOptions(options, Unit.Hour) as [ - TimeUnit, - number, - RoundingMode, - ]), - ) + // workaround for https://github.com/swc-project/swc/issues/8806 + const [a, b, c] = refineRoundingOptions(options, Unit.Hour) as [ + TimeUnit, + number, + RoundingMode, + ] + const roundedIsoFields = roundTime(slots, a, b, c) return createPlainTimeSlots(roundedIsoFields) }