| 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 JSSyntaxRegExp(String pattern, | 10 JSSyntaxRegExp(String pattern, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 if (!isJSArray(charCodes)) { | 36 if (!isJSArray(charCodes)) { |
| 37 if (charCodes is !List) throw new IllegalArgumentException(charCodes); | 37 if (charCodes is !List) throw new IllegalArgumentException(charCodes); |
| 38 charCodes = new List.from(charCodes); | 38 charCodes = new List.from(charCodes); |
| 39 } | 39 } |
| 40 return Primitives.stringFromCharCodes(charCodes); | 40 return Primitives.stringFromCharCodes(charCodes); |
| 41 } | 41 } |
| 42 | 42 |
| 43 static String join(List<String> strings, String separator) { | 43 static String join(List<String> strings, String separator) { |
| 44 checkNull(strings); | 44 checkNull(strings); |
| 45 checkNull(separator); | 45 checkNull(separator); |
| 46 if (separator is !String) throw new IllegalArgumentException(separator); | |
| 47 var result = ""; | 46 var result = ""; |
| 48 var first = true; | 47 var first = true; |
| 49 for (var string in strings) { | 48 for (var string in strings) { |
| 50 checkNull(string); | 49 checkNull(string); |
| 51 if (string is !String) throw new IllegalArgumentException(string); | 50 if (string is !String) throw new IllegalArgumentException(string); |
| 52 if (!first) result += separator; // TODO(ahe): Use string buffer. | 51 if (!first) result += separator; // TODO(ahe): Use string buffer. |
| 53 result += string; // TODO(ahe): Use string buffer. | 52 result += string; // TODO(ahe): Use string buffer. |
| 54 first = false; | 53 first = false; |
| 55 } | 54 } |
| 56 return result; | 55 return result; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } | 272 } |
| 274 String twoDigitMinutes = | 273 String twoDigitMinutes = |
| 275 twoDigits(inMinutes.remainder(Duration.MINUTES_PER_HOUR)); | 274 twoDigits(inMinutes.remainder(Duration.MINUTES_PER_HOUR)); |
| 276 String twoDigitSeconds = | 275 String twoDigitSeconds = |
| 277 twoDigits(inSeconds.remainder(Duration.SECONDS_PER_MINUTE)); | 276 twoDigits(inSeconds.remainder(Duration.SECONDS_PER_MINUTE)); |
| 278 String threeDigitMs = | 277 String threeDigitMs = |
| 279 threeDigits(inMilliseconds.remainder(Duration.MILLISECONDS_PER_SECOND)); | 278 threeDigits(inMilliseconds.remainder(Duration.MILLISECONDS_PER_SECOND)); |
| 280 return "${inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${threeDigitMs}"; | 279 return "${inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${threeDigitMs}"; |
| 281 } | 280 } |
| 282 } | 281 } |
| OLD | NEW |