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

Side by Side Diff: dart/frog/leg/lib/mockimpl.dart

Issue 9423034: Implement most of String API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 16 matching lines...) Expand all
27 27
28 factory ReceivePort.singleShot() { 28 factory ReceivePort.singleShot() {
29 throw 'factory ReceivePort.singleShot is not implemented'; 29 throw 'factory ReceivePort.singleShot is not implemented';
30 } 30 }
31 } 31 }
32 32
33 class StringBase { 33 class StringBase {
34 static String createFromCharCodes(List<int> charCodes) { 34 static String createFromCharCodes(List<int> charCodes) {
35 checkNull(charCodes); 35 checkNull(charCodes);
36 if (!isJSArray(charCodes)) { 36 if (!isJSArray(charCodes)) {
37 if (charCodes is !List) throw new IllegalArgumentException(charCodes);
37 charCodes = new List.from(charCodes); 38 charCodes = new List.from(charCodes);
38 } 39 }
39 return Primitives.stringFromCharCodes(charCodes); 40 return Primitives.stringFromCharCodes(charCodes);
40 } 41 }
41 42
42 static String join(List<String> strings, String separator) { 43 static String join(List<String> strings, String separator) {
43 checkNull(strings); 44 checkNull(strings);
44 checkNull(separator); 45 checkNull(separator);
45 if (separator is !String) throw new IllegalArgumentException(separator); 46 if (separator is !String) throw new IllegalArgumentException(separator);
46 var result = ""; 47 var result = "";
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 factory List([int length]) => Primitives.newList(length); 455 factory List([int length]) => Primitives.newList(length);
455 factory List.from(Iterable<E> other) { 456 factory List.from(Iterable<E> other) {
456 List<E> result = new List<E>(); 457 List<E> result = new List<E>();
457 Iterator<E> iterator = other.iterator(); 458 Iterator<E> iterator = other.iterator();
458 while (iterator.hasNext()) { 459 while (iterator.hasNext()) {
459 result.add(iterator.next()); 460 result.add(iterator.next());
460 } 461 }
461 return result; 462 return result;
462 } 463 }
463 } 464 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698