Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(704)

Unified Diff: sdk/lib/core/duration.dart

Issue 2738963002: DateTime and Duration tweaks for better dart2js codegen (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/core_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/duration.dart
diff --git a/sdk/lib/core/duration.dart b/sdk/lib/core/duration.dart
index f2dd01b331eda4fd350d41001d5e2686db7d2760..bc1364fba3e3daf3bd71a2a3b76ddc17b392343a 100644
--- a/sdk/lib/core/duration.dart
+++ b/sdk/lib/core/duration.dart
@@ -295,5 +295,6 @@ class Duration implements Comparable<Duration> {
* The returned `Duration` has the same length as this one, but will have the
* opposite sign of this one.
*/
- Duration operator -() => new Duration._microseconds(-_duration);
+ // Using subtraction helps dart2js avoid negative zeros.
+ Duration operator -() => new Duration._microseconds(0 - _duration);
}
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/core_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698