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

Unified Diff: runtime/lib/string_patch.dart

Issue 13774006: Moving ListBase, FixedLengthListMixin and UmodifiableListMixin to collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Moved ReversedListIterable back to collection-dev Created 7 years, 8 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
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | sdk/lib/_collection_dev/collection_dev.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string_patch.dart
diff --git a/runtime/lib/string_patch.dart b/runtime/lib/string_patch.dart
index 1ba5e1a919b43b74d7d4800ca746f5ba47c2d67b..43101b0e47580695298a33a27c167640876e4aeb 100644
--- a/runtime/lib/string_patch.dart
+++ b/runtime/lib/string_patch.dart
@@ -417,7 +417,7 @@ class _StringBase {
return result;
}
- List<int> get codeUnits => new CodeUnits(this);
+ List<int> get codeUnits => new _CodeUnits(this);
Runes get runes => new Runes(this);
@@ -613,3 +613,17 @@ class _StringMatch implements Match {
final String str;
final String pattern;
}
+
+/**
+ * An [Iterable] of the UTF-16 code units of a [String] in index order.
+ */
+class _CodeUnits extends Object with ListMixin<int>,
+ UnmodifiableListMixin<int> {
+ /** The string that this is the code units of. */
+ String _string;
+
+ _CodeUnits(this._string);
+
+ int get length => _string.length;
+ int operator[](int i) => _string.codeUnitAt(i);
+}
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | sdk/lib/_collection_dev/collection_dev.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698