Skip to content

Commit

Permalink
Fix remaining instance where DateTime accesses the private member _value
Browse files Browse the repository at this point in the history
This does not work if the DateTime accessed is an implementation of
the DateTime interface, rather than an instance of the same class.

Related issues:

* #34962
* srawlins/timezone#57

Related changes:

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

Closes #42351
#42351

GitOrigin-RevId: 877ae83
Change-Id: I91205292bb91d7958c4b3687135a8152d6ebbe6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151322
Reviewed-by: Siva Annamalai <[email protected]>
Commit-Queue: Michael Thomsen <[email protected]>
  • Loading branch information
matthewlloyd authored and [email protected] committed Nov 2, 2020
1 parent 2613251 commit 30ba97b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/lib/_internal/vm/lib/date_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class DateTime {

@patch
Duration difference(DateTime other) {
return new Duration(microseconds: _value - other._value);
return new Duration(microseconds: _value - other.microsecondsSinceEpoch);
}

@patch
Expand Down

0 comments on commit 30ba97b

Please sign in to comment.