-
Notifications
You must be signed in to change notification settings - Fork 155
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
Decide TypeScript type of ZonedDateTime.prototype.timeZone #1041
Comments
Wait, don't all |
They do! But not all objects implementing the |
They do. The problem is that most of the properties and members are optional, which means that anyone using Given the docs changes that Philip added in #1043, I think we're safe in changing the type of
This seems like a strong enough guarantee that code that follows best practices will quack like a |
This issue no longer applies to the proposal. Polyfills will have to decide this for themselves. |
Follow-up from #1037/#810.
The current type of the ZonedDateTime.prototype.timeZone property is TimeZoneProtocol in the TypeScript bindings. This is annoying because the methods in the protocol are optional, and so you have to write an extra
as Temporal.TimeZone
to deal with it in the 99.9% case, whereas the case where you have purposely introduced a TimeZoneProtocol object without all the methods is very rare. But on the other hand, leaving it as-is leaves maximal choice for the code author.The text was updated successfully, but these errors were encountered: