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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_string.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 | « sdk/lib/_collection_dev/list.dart ('k') | sdk/lib/collection/collection.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/lib/js_string.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_string.dart b/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
index 395f970950757c552d77e0d0ae35d88f1c005f08..e6184c0d893fc9fe19a4db0f3bc1b97c00464754 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
@@ -137,7 +137,7 @@ class JSString extends Interceptor implements String, JSIndexable {
return JS('String', r'#.trim()', this);
}
- List<int> get codeUnits => new CodeUnits(this);
+ List<int> get codeUnits => new _CodeUnits(this);
Runes get runes => new Runes(this);
@@ -211,3 +211,16 @@ class JSString extends Interceptor implements String, JSIndexable {
return JS('String', '#[#]', this, index);
}
}
+
+/**
+ * An [Iterable] of the UTF-16 code units of a [String] in index order.
+ */
+class _CodeUnits extends UnmodifiableListBase<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 | « sdk/lib/_collection_dev/list.dart ('k') | sdk/lib/collection/collection.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698