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

Unified Diff: lib/compiler/implementation/lib/coreimpl_patch.dart

Issue 11085003: Convert String to a class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove left-over List change in comment. Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/lib/coreimpl_patch.dart
diff --git a/lib/compiler/implementation/lib/coreimpl_patch.dart b/lib/compiler/implementation/lib/coreimpl_patch.dart
index 124c48e53062c185dd880c0df897ec0fae0cfe09..c6d161f98ef43bb9e12280c1d6bac5dc09712aec 100644
--- a/lib/compiler/implementation/lib/coreimpl_patch.dart
+++ b/lib/compiler/implementation/lib/coreimpl_patch.dart
@@ -4,57 +4,9 @@
// Patch file for dart:coreimpl classes.
-// Patch for String implementation.
-// TODO(ager): Split out into date_patch.dart and allow #source
-// in patch files?
-patch class StringImplementation {
- patch static String _fromCharCodes(List<int> charCodes) {
- checkNull(charCodes);
- if (!isJsArray(charCodes)) {
- if (charCodes is !List) throw new ArgumentError(charCodes);
- charCodes = new List.from(charCodes);
- }
- return Primitives.stringFromCharCodes(charCodes);
- }
-
- patch String join(List<String> strings, String separator) {
- checkNull(strings);
- checkNull(separator);
- if (separator is !String) throw new ArgumentError(separator);
- return stringJoinUnchecked(_toJsStringArray(strings), separator);
- }
-
- patch String concatAll(List<String> strings) {
- return stringJoinUnchecked(_toJsStringArray(strings), "");
- }
-
- static List _toJsStringArray(List<String> strings) {
- checkNull(strings);
- var array;
- final length = strings.length;
- if (isJsArray(strings)) {
- array = strings;
- for (int i = 0; i < length; i++) {
- final string = strings[i];
- checkNull(string);
- if (string is !String) throw new ArgumentError(string);
- }
- } else {
- array = new List(length);
- for (int i = 0; i < length; i++) {
- final string = strings[i];
- checkNull(string);
- if (string is !String) throw new ArgumentError(string);
- array[i] = string;
- }
- }
- return array;
- }
-}
-
// Patch for List implementation.
-// TODO(ager): Split out into date_patch.dart and allow #source
+// TODO(ager): Split out into list_patch.dart and allow #source
// in patch files?
patch class ListImplementation<E> {
patch factory List([int length]) => Primitives.newList(length);

Powered by Google App Engine
This is Rietveld 408576698