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

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

Issue 10970009: Add list.removeAt method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « no previous file | lib/core/list.dart » ('j') | lib/core/list.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/interceptors.dart
diff --git a/lib/compiler/implementation/lib/interceptors.dart b/lib/compiler/implementation/lib/interceptors.dart
index 25e5501d3e66c66d78c51ae1dab48dcbccafce02..a53ee7d08e8c0f4944b67b9814d81859240b0608 100644
--- a/lib/compiler/implementation/lib/interceptors.dart
+++ b/lib/compiler/implementation/lib/interceptors.dart
@@ -16,6 +16,19 @@ add$1(var receiver, var value) {
return UNINTERCEPTED(receiver.add(value));
}
+removeAt$1(var receiver, var index) {
+ if (isJsArray(receiver)) {
+ if (index is !int) throw new IllegalArgumentException(index);
+ if (index < 0 || index >= receiver.length) {
+ throw new IndexOutOfRangeException(index);
+ }
+ checkGrowable(receiver, 'removeAt');
+ return JS("Object", @'#.splice(#, 1)[0]', receiver, index);
+
+ }
+ return UNINTERCEPTED(receiver.removeAt(index));
+}
+
removeLast(var receiver) {
if (isJsArray(receiver)) {
checkGrowable(receiver, 'removeLast');
« no previous file with comments | « no previous file | lib/core/list.dart » ('j') | lib/core/list.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698