Skip to content

[CP] Bugfix for web DateTime, to 2.19 #50821

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

Closed
lrhn opened this issue Dec 21, 2022 · 1 comment
Closed

[CP] Bugfix for web DateTime, to 2.19 #50821

lrhn opened this issue Dec 21, 2022 · 1 comment
Assignees
Labels
cherry-pick-approved Label for approved cherrypick request cherry-pick-review Issue that need cherry pick triage to approve merge-to-beta

Comments

@lrhn
Copy link
Member

lrhn commented Dec 21, 2022

Commit(s) to merge

8ad7661

Target

beta

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/277002

Issue Description

A use of a private variable, instead of the public getter exposing it, made the web DateTime classes incompatible with custom implementations. Combined with the 2.19 language change of not forwarding implicit implementations of inaccessible members to noSuchMethod, means that existing workarounds using noSuchMethod also won't work.

See #50750 for an issue where the problem arose.

What is the fix

Just read the millisecondsSinceEpoch using the public getter instead of the private field.

Why cherry-pick

Existing code is broken with no workaround. They'd like the fix to be available along with the language change that breaks the existing workaround.

Risk

low

Issue link(s)

#50750

Extra Info

No response

@lrhn lrhn added the cherry-pick-review Issue that need cherry pick triage to approve label Dec 21, 2022
@mit-mit
Copy link
Member

mit-mit commented Dec 22, 2022

SGTM

@itsjustkevin itsjustkevin added merge-to-beta cherry-pick-approved Label for approved cherrypick request labels Dec 24, 2022
copybara-service bot pushed a commit that referenced this issue Jan 2, 2023
…ion.

Changes `other._value` to `other.millisecondsSinceEpoch`,
which prevents crashing if provided with a different implementation
of `DateTime`.

Exposed by #50750.

Bug: https://dartbug.com/50750
Cherry-pick: #50821
Change-Id: I1dfc0bb4e8a44ef0df432c9a916a6620691e0547
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277002
Commit-Queue: Lasse Nielsen <[email protected]>
Reviewed-by: Nate Bosch <[email protected]>
Auto-Submit: Lasse Nielsen <[email protected]>
@lrhn lrhn closed this as completed Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Label for approved cherrypick request cherry-pick-review Issue that need cherry pick triage to approve merge-to-beta
Projects
None yet
Development

No branches or pull requests

6 participants