You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add internal create operations to avoid observable effects
The constructors of PlainDate, PlainDateTime, PlainMonthDay,
PlainYearMonth, and ZonedDateTime call ToTemporalCalendar on the calendar
argument, and the constructor of ZonedDateTime additionally calls
ToTemporalTimeZone on its timeZone argument. Now that these operations
include an observable HasProperty operation, we do not want to call them
more than once on the same calendar or time zone object.
Therefore we add CreateTemporalDate etc. which create an instance without
any observable validation of the arguments.
The spec text already works like this, with abstract operations such as
CreateTemporalZonedDateTime and friends that do not call
ToTemporalCalendar or ToTemporalTimeZone. So this is not a normative
change; it's a compliance bug in the polyfill. It is required for the
test262 tests in 19cd26f7 to pass, which observe HasProperty(`timeZone`)
operations.
See: #1428
0 commit comments