diff --git a/polyfill/lib/ecmascript.mjs b/polyfill/lib/ecmascript.mjs index 640cb40592..28b4357245 100644 --- a/polyfill/lib/ecmascript.mjs +++ b/polyfill/lib/ecmascript.mjs @@ -1496,7 +1496,7 @@ export const ES = ObjectAssign({}, ES2020, { } // "prefer" or "reject" - const possibleInstants = timeZone.getPossibleInstantsFor(dt); + const possibleInstants = ES.GetPossibleInstantsFor(timeZone, dt); for (const candidate of possibleInstants) { const candidateOffset = ES.GetOffsetNanosecondsFor(timeZone, candidate); if (candidateOffset === offsetNs) return GetSlot(candidate, EPOCHNANOSECONDS); @@ -2051,7 +2051,7 @@ export const ES = ObjectAssign({}, ES2020, { GetPossibleInstantsFor: (timeZone, dateTime) => { let getPossibleInstantsFor = ES.GetMethod(timeZone, 'getPossibleInstantsFor'); const possibleInstants = ES.Call(getPossibleInstantsFor, timeZone, [dateTime]); - const result = ES.CreateListFromArrayLike(possibleInstants, ['Object']); + const result = [...possibleInstants]; const numInstants = result.length; for (let ix = 0; ix < numInstants; ix++) { if (!ES.IsTemporalInstant(result[ix])) { @@ -3844,6 +3844,7 @@ export const ES = ObjectAssign({}, ES2020, { }, MoveRelativeDate: (calendar, relativeTo, duration) => { const later = ES.CalendarDateAdd(calendar, relativeTo, duration, {}); + relativeTo = ES.ToTemporalDateTime(relativeTo); const days = ES.DaysUntil(relativeTo, later); relativeTo = ES.CreateTemporalDateTime( GetSlot(later, ISO_YEAR), diff --git a/spec/timezone.html b/spec/timezone.html index 33da16b8fe..6c0230dbf8 100644 --- a/spec/timezone.html +++ b/spec/timezone.html @@ -626,7 +626,7 @@

BuiltinTimeZoneGetInstantFor ( _timeZone_, _dateTime_, _disambiguation_ )GetPossibleInstantsFor ( _timeZone_, _dateTime_ )

1. Let _possibleInstants_ be ? Invoke(_timeZone_, *"getPossibleInstantsFor"*, « _dateTime_ »). - 1. Let _list_ be ? CreateListFromArrayLike(_possibleInstants_, « Object »). + 1. Let _list_ be ? IterableToList(_possibleInstants_). 1. For each element _instant_ in _list_ in List order, do 1. Perform ? RequireInternalSlot(_instant_, [[InitializedTemporalInstant]]). 1. Return _list_.