diff --git a/polyfill/lib/duration.mjs b/polyfill/lib/duration.mjs index d7ec5a4e7..e710b60c6 100644 --- a/polyfill/lib/duration.mjs +++ b/polyfill/lib/duration.mjs @@ -160,23 +160,8 @@ export class Duration { } with(durationLike) { if (!ES.IsTemporalDuration(this)) throw new TypeError('invalid receiver'); - const partialDuration = ES.PrepareTemporalFields( - durationLike, - [ - 'days', - 'hours', - 'microseconds', - 'milliseconds', - 'minutes', - 'months', - 'nanoseconds', - 'seconds', - 'weeks', - 'years' - ], - 'partial' - ); - let { + const partialDuration = ES.ToTemporalPartialDurationRecord(durationLike); + const { years = GetSlot(this, YEARS), months = GetSlot(this, MONTHS), weeks = GetSlot(this, WEEKS), diff --git a/polyfill/lib/ecmascript.mjs b/polyfill/lib/ecmascript.mjs index ac1cb554a..c7b5833ad 100644 --- a/polyfill/lib/ecmascript.mjs +++ b/polyfill/lib/ecmascript.mjs @@ -229,16 +229,6 @@ const BUILTIN_CASTS = new Map([ ['millisecond', ToIntegerWithTruncation], ['microsecond', ToIntegerWithTruncation], ['nanosecond', ToIntegerWithTruncation], - ['years', ToIntegerIfIntegral], - ['months', ToIntegerIfIntegral], - ['weeks', ToIntegerIfIntegral], - ['days', ToIntegerIfIntegral], - ['hours', ToIntegerIfIntegral], - ['minutes', ToIntegerIfIntegral], - ['seconds', ToIntegerIfIntegral], - ['milliseconds', ToIntegerIfIntegral], - ['microseconds', ToIntegerIfIntegral], - ['nanoseconds', ToIntegerIfIntegral], ['offset', ToPrimitiveAndRequireString] ]);