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

Unified Diff: runtime/lib/array.dart

Issue 11316059: Add List.first. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add dart2js interceptor and add test. Created 8 years, 1 month 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 | « no previous file | runtime/lib/byte_array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/array.dart
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index 1fb17fb8ecf4d9927e21e4fbe38cf604fa7fbb67..5bef0d0db28ec84e79e2c396c37e0822799c5a66 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -138,6 +138,10 @@ class _ObjectArray<E> implements List<E> {
"Cannot remove in a non-extendable array");
}
+ E get first {
+ return this[0];
+ }
+
E get last {
return this[length - 1];
}
@@ -285,6 +289,10 @@ class _ImmutableArray<E> implements List<E> {
"Cannot remove in a non-extendable array");
}
+ E get first {
+ return this[0];
+ }
+
E get last {
return this[length - 1];
}
« no previous file with comments | « no previous file | runtime/lib/byte_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698