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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * A span of time, such as 27 days, 4 hours, 12 minutes, and 3 seconds. 8 * A span of time, such as 27 days, 4 hours, 12 minutes, and 3 seconds.
9 * 9 *
10 * A `Duration` represents a difference from one point in time to another. The 10 * A `Duration` represents a difference from one point in time to another. The
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 * positive. 288 * positive.
289 */ 289 */
290 Duration abs() => new Duration._microseconds(_duration.abs()); 290 Duration abs() => new Duration._microseconds(_duration.abs());
291 291
292 /** 292 /**
293 * Returns a new `Duration` representing this `Duration` negated. 293 * Returns a new `Duration` representing this `Duration` negated.
294 * 294 *
295 * The returned `Duration` has the same length as this one, but will have the 295 * The returned `Duration` has the same length as this one, but will have the
296 * opposite sign of this one. 296 * opposite sign of this one.
297 */ 297 */
298 Duration operator -() => new Duration._microseconds(-_duration); 298 // Using subtraction helps dart2js avoid negative zeros.
299 Duration operator -() => new Duration._microseconds(0 - _duration);
299 } 300 }
OLDNEW
« 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