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.ZonedDateTime.prototype.toLocaleString: Unnecessary steps to format time zone #3057

Closed
anba opened this issue Dec 9, 2024 · 0 comments
Assignees
Labels
editorial spec-text Specification text involved

Comments

@anba
Copy link
Contributor

anba commented Dec 9, 2024

Temporal.ZonedDateTime.prototype.toLocaleString, step 4-6 look unnecessary to me. The same steps are performed in Temporal.ZonedDateTime and ToTemporalTimeZoneIdentifier, so I don't see why zonedDateTime.[[TimeZone]] can't be directly passed to CreateDateTimeFormat.

@ptomato ptomato self-assigned this Dec 10, 2024
@ptomato ptomato added spec-text Specification text involved editorial labels Dec 10, 2024
ptomato added a commit that referenced this issue Dec 11, 2024
This removes some steps that can throw and therefore look observable, but
they were effectively dead code; the value stored in the [[TimeZone]]
internal slot is guaranteed to be a valid available time zone identifier.

h/t Anba

Closes: #3057
@Ms2ger Ms2ger closed this as completed in 065cf94 Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial spec-text Specification text involved
Projects
None yet
Development

No branches or pull requests

2 participants