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

Unified Diff: lib/coreimpl/date.dart

Issue 11090016: Change core lib, dart2js, and more for new optional parameters syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 | « lib/core/date.dart ('k') | pkg/args/lib/args.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/coreimpl/date.dart
===================================================================
--- lib/coreimpl/date.dart (revision 13683)
+++ lib/coreimpl/date.dart (working copy)
@@ -53,7 +53,8 @@
throw new ArgumentError(formattedString);
}
if (addOneMillisecond) millisecondsSinceEpoch++;
- return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, isUtc);
+ return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch,
+ isUtc: isUtc);
} else {
throw new ArgumentError(formattedString);
}
@@ -93,14 +94,16 @@
Date toLocal() {
if (isUtc) {
- return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, false);
+ return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch,
+ isUtc: false);
}
return this;
}
Date toUtc() {
if (isUtc) return this;
- return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, true);
+ return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch,
+ isUtc: true);
}
String toString() {
@@ -142,14 +145,14 @@
Date add(Duration duration) {
int ms = millisecondsSinceEpoch;
return new Date.fromMillisecondsSinceEpoch(
- ms + duration.inMilliseconds, isUtc);
+ ms + duration.inMilliseconds, isUtc: isUtc);
}
/** Returns a new [Date] with the [duration] subtracted from [this]. */
Date subtract(Duration duration) {
int ms = millisecondsSinceEpoch;
return new Date.fromMillisecondsSinceEpoch(
- ms - duration.inMilliseconds, isUtc);
+ ms - duration.inMilliseconds, isUtc: isUtc);
}
/** Returns a [Duration] with the difference of [this] and [other]. */
@@ -159,15 +162,14 @@
return new Duration(milliseconds: ms - otherMs);
}
- // TODO(lrn): Make parameters not optional for the implementation class.
external DateImplementation(int year,
- [int month = 1,
- int day = 1,
- int hour = 0,
- int minute = 0,
- int second = 0,
- int millisecond = 0,
- bool isUtc = false]);
+ int month,
+ int day,
+ int hour,
+ int minute,
+ int second,
+ int millisecond,
+ bool isUtc);
external DateImplementation.now();
external static int _brokenDownDateToMillisecondsSinceEpoch(
int year, int month, int day, int hour, int minute, int second,
« no previous file with comments | « lib/core/date.dart ('k') | pkg/args/lib/args.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698