Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporal: Use strings in [[Calendar]] and [[TimeZone]] slots to represent builtin calendars and time zones #3788

Merged
merged 10 commits into from
Apr 7, 2023

Conversation

ptomato
Copy link
Contributor

@ptomato ptomato commented Feb 17, 2023

See tc39/proposal-temporal#1808 for motivation and tc39/proposal-temporal#2482 for the normative PR that was approved at the January-February 2023 TC39 plenary.

Separated into several commits for ease of review; I'd recommend reviewing it commit by commit and skimming over the commits that mostly consist of straightforward search-and-replace.

Now.timeZoneId() returns a string so that it can be used to construct
objects that have the builtin time zone behaviour.

Normative PR: tc39/proposal-temporal#2482
Has several effects on existing tests:
- Remove PlainTime from various tests that extract a Temporal.Calendar
  instance from another Temporal object.
- Remove Temporal.PlainTime.prototype.calendar property.
- Remove calendar property from object returned from
  Temporal.PlainTime.prototype.getISOFields().
- Ignore calendar annotation when converting ISO string to PlainTime.

Normative PR: tc39/proposal-temporal#2482
…ndar

This is the replacement of the old API with the new API. Semantics will be
corrected in the following commit.

Normative PR: tc39/proposal-temporal#2482
In several tests involving custom calendars, we need to change the
implementation of dateFromFields/monthDayFromFields/yearMonthFromFields so
that the returned object gets the receiver as its calendar after chaining
up to the builtin implementation.

Normative PR: tc39/proposal-temporal#2482
Compare semantics for custom calendars that _don't_ extend
Temporal.Calendar (and therefore don't have the internal slot) use the
value of the .id property, instead of calling toString().

Normative PR: tc39/proposal-temporal#2482
This is the replacement of the old API with the new API, .timeZoneId and
.getTimeZone(). Semantics will be corrected in the following commit.

Normative PR: tc39/proposal-temporal#2482
Compare semantics for custom time zones that _don't_ extend
Temporal.TimeZone (and therefore don't have the internal slot) use the
value of the .id property, instead of calling toString().

Normative PR: tc39/proposal-temporal#2482
@ptomato
Copy link
Contributor Author

ptomato commented Apr 7, 2023

Thanks. I'm about to push an update to the corresponding proposal-temporal PR that resolves all the comments there. I'll merge this now, so that it can pull in a test262 update and run against these tests.

@ptomato ptomato merged commit 0178aa2 into tc39:main Apr 7, 2023
@ptomato ptomato deleted the temporal-1808 branch April 7, 2023 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants