Chromium Code Reviews| 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 /** | 5 /** |
| 6 * [_StringBase] contains common methods used by concrete String | 6 * [_StringBase] contains common methods used by concrete String |
| 7 * implementations, e.g., _OneByteString. | 7 * implementations, e.g., _OneByteString. |
| 8 */ | 8 */ |
| 9 class _StringBase { | 9 class _StringBase { |
| 10 | 10 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 return buffer.toString(); | 340 return buffer.toString(); |
| 341 } | 341 } |
| 342 | 342 |
| 343 | 343 |
| 344 /** | 344 /** |
| 345 * Convert all objects in [values] to strings and concat them | 345 * Convert all objects in [values] to strings and concat them |
| 346 * into a result string. | 346 * into a result string. |
| 347 */ | 347 */ |
| 348 static String _interpolate(List values) { | 348 static String _interpolate(List values) { |
| 349 int numValues = values.length; | 349 int numValues = values.length; |
| 350 var stringList = new List.fixedLength(numValues); | 350 var stringList = new _ObjectArray(numValues); |
|
floitsch
2013/02/26 13:54:19
new List(numValues) doesn't work?
Lasse Reichstein Nielsen
2013/02/26 15:26:00
It didn't at some point, probably before I changed
| |
| 351 for (int i = 0; i < numValues; i++) { | 351 for (int i = 0; i < numValues; i++) { |
| 352 stringList[i] = values[i].toString(); | 352 stringList[i] = values[i].toString(); |
| 353 } | 353 } |
| 354 return _concatAll(stringList); | 354 return _concatAll(stringList); |
| 355 } | 355 } |
| 356 | 356 |
| 357 Iterable<Match> allMatches(String str) { | 357 Iterable<Match> allMatches(String str) { |
| 358 List<Match> result = new List<Match>(); | 358 List<Match> result = new List<Match>(); |
| 359 int length = str.length; | 359 int length = str.length; |
| 360 int patternLength = this.length; | 360 int patternLength = this.length; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 602 for (int g in groups) { | 602 for (int g in groups) { |
| 603 result.add(group(g)); | 603 result.add(group(g)); |
| 604 } | 604 } |
| 605 return result; | 605 return result; |
| 606 } | 606 } |
| 607 | 607 |
| 608 final int start; | 608 final int start; |
| 609 final String str; | 609 final String str; |
| 610 final String pattern; | 610 final String pattern; |
| 611 } | 611 } |
| OLD | NEW |