| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Mocks of classes and interfaces that Leg cannot read directly. | 5 // Mocks of classes and interfaces that Leg cannot read directly. |
| 6 | 6 |
| 7 // TODO(ahe): Remove this file. | 7 // TODO(ahe): Remove this file. |
| 8 | 8 |
| 9 class JSSyntaxRegExp implements RegExp { | 9 class JSSyntaxRegExp implements RegExp { |
| 10 final String pattern; | 10 final String pattern; |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 | 273 |
| 274 const DateImplementation.fromEpoch(this.value, this.timeZone); | 274 const DateImplementation.fromEpoch(this.value, this.timeZone); |
| 275 | 275 |
| 276 bool operator ==(other) { | 276 bool operator ==(other) { |
| 277 if (!(other is DateImplementation)) return false; | 277 if (!(other is DateImplementation)) return false; |
| 278 return (value == other.value) && (timeZone == other.timeZone); | 278 return (value == other.value) && (timeZone == other.timeZone); |
| 279 } | 279 } |
| 280 | 280 |
| 281 int compareTo(Date other) { | 281 bool operator <(Date other) => value < other.value; |
| 282 checkNull(other); | 282 |
| 283 return value.compareTo(other.value); | 283 bool operator <=(Date other) => value <= other.value; |
| 284 } | 284 |
| 285 bool operator >(Date other) => value > other.value; |
| 286 |
| 287 bool operator >=(Date other) => value >= other.value; |
| 288 |
| 289 int compareTo(Date other) => value.compareTo(other.value); |
| 285 | 290 |
| 286 int hashCode() => value; | 291 int hashCode() => value; |
| 287 | 292 |
| 288 Date changeTimeZone(TimeZone targetTimeZone) { | 293 Date changeTimeZone(TimeZone targetTimeZone) { |
| 289 if (targetTimeZone == null) { | 294 if (targetTimeZone == null) { |
| 290 targetTimeZone = new TimeZoneImplementation.local(); | 295 targetTimeZone = new TimeZoneImplementation.local(); |
| 291 } | 296 } |
| 292 return new Date.fromEpoch(value, targetTimeZone); | 297 return new Date.fromEpoch(value, targetTimeZone); |
| 293 } | 298 } |
| 294 | 299 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 factory List.from(Iterable<E> other) { | 390 factory List.from(Iterable<E> other) { |
| 386 List<E> result = new List<E>(); | 391 List<E> result = new List<E>(); |
| 387 // TODO(ahe): Use for-in when it is implemented correctly. | 392 // TODO(ahe): Use for-in when it is implemented correctly. |
| 388 Iterator<E> iterator = other.iterator(); | 393 Iterator<E> iterator = other.iterator(); |
| 389 while (iterator.hasNext()) { | 394 while (iterator.hasNext()) { |
| 390 result.add(iterator.next()); | 395 result.add(iterator.next()); |
| 391 } | 396 } |
| 392 return result; | 397 return result; |
| 393 } | 398 } |
| 394 } | 399 } |
| OLD | NEW |