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

Unified Diff: lib/compiler/implementation/lib/mockimpl.dart

Issue 10399027: Add comparison operators to Date class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add new lines. Created 8 years, 7 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 | « frog/lib/date_implementation.dart ('k') | runtime/lib/date.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/mockimpl.dart
diff --git a/lib/compiler/implementation/lib/mockimpl.dart b/lib/compiler/implementation/lib/mockimpl.dart
index 8f24860cb81145857ec81091823fca41980e7266..2a6171f7adc2f2763a0c80bd84671d385692f1cf 100644
--- a/lib/compiler/implementation/lib/mockimpl.dart
+++ b/lib/compiler/implementation/lib/mockimpl.dart
@@ -278,10 +278,15 @@ class DateImplementation implements Date {
return (value == other.value) && (timeZone == other.timeZone);
}
- int compareTo(Date other) {
- checkNull(other);
- return value.compareTo(other.value);
- }
+ bool operator <(Date other) => value < other.value;
+
+ bool operator <=(Date other) => value <= other.value;
+
+ bool operator >(Date other) => value > other.value;
+
+ bool operator >=(Date other) => value >= other.value;
+
+ int compareTo(Date other) => value.compareTo(other.value);
int hashCode() => value;
« no previous file with comments | « frog/lib/date_implementation.dart ('k') | runtime/lib/date.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698