| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 290 |
| 291 int hashCode() => value; | 291 int hashCode() => value; |
| 292 | 292 |
| 293 Date changeTimeZone(TimeZone targetTimeZone) { | 293 Date changeTimeZone(TimeZone targetTimeZone) { |
| 294 if (targetTimeZone == null) { | 294 if (targetTimeZone == null) { |
| 295 targetTimeZone = new TimeZoneImplementation.local(); | 295 targetTimeZone = new TimeZoneImplementation.local(); |
| 296 } | 296 } |
| 297 return new Date.fromEpoch(value, targetTimeZone); | 297 return new Date.fromEpoch(value, targetTimeZone); |
| 298 } | 298 } |
| 299 | 299 |
| 300 String get timeZoneName() { |
| 301 if (isUtc()) return "UTC"; |
| 302 return Primitives.getTimeZoneName(this); |
| 303 } |
| 304 |
| 305 Duration get timeZoneOffset() { |
| 306 if (isUtc()) return new Duration(0); |
| 307 return new Duration(minutes: Primitives.getTimeZoneOffsetInMinutes(this)); |
| 308 } |
| 309 |
| 300 int get year() => Primitives.getYear(this); | 310 int get year() => Primitives.getYear(this); |
| 301 | 311 |
| 302 int get month() => Primitives.getMonth(this); | 312 int get month() => Primitives.getMonth(this); |
| 303 | 313 |
| 304 int get day() => Primitives.getDay(this); | 314 int get day() => Primitives.getDay(this); |
| 305 | 315 |
| 306 int get hours() => Primitives.getHours(this); | 316 int get hours() => Primitives.getHours(this); |
| 307 | 317 |
| 308 int get minutes() => Primitives.getMinutes(this); | 318 int get minutes() => Primitives.getMinutes(this); |
| 309 | 319 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 factory List.from(Iterable<E> other) { | 400 factory List.from(Iterable<E> other) { |
| 391 List<E> result = new List<E>(); | 401 List<E> result = new List<E>(); |
| 392 // TODO(ahe): Use for-in when it is implemented correctly. | 402 // TODO(ahe): Use for-in when it is implemented correctly. |
| 393 Iterator<E> iterator = other.iterator(); | 403 Iterator<E> iterator = other.iterator(); |
| 394 while (iterator.hasNext()) { | 404 while (iterator.hasNext()) { |
| 395 result.add(iterator.next()); | 405 result.add(iterator.next()); |
| 396 } | 406 } |
| 397 return result; | 407 return result; |
| 398 } | 408 } |
| 399 } | 409 } |
| OLD | NEW |