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

Unified Diff: runtime/lib/growable_array.dart

Issue 10960011: Made removeAt errors consistent between dart2js and VM. (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 | « lib/core/list.dart ('k') | tests/corelib/corelib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/growable_array.dart
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index abdbb9d4959258209678f6b858f8049ebe32c66f..08a5c178370629c23d08afa7964bf2fd8fb3b7be 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -8,8 +8,9 @@ class GrowableObjectArray<T> implements List<T> {
"GrowableObjectArray can only be allocated by the VM");
}
- E removeAt(int index) {
- E result = this[index];
+ T removeAt(int index) {
+ if (index is! int) throw new IllegalArgumentException(index);
+ T result = this[index];
Arrays.copy(this,
kasperl 2012/09/20 12:42:41 Cache this.length in a local variable?
Lasse Reichstein Nielsen 2012/09/20 12:52:30 Better yet, I'll cache this.length - 1.
index + 1,
this,
« no previous file with comments | « lib/core/list.dart ('k') | tests/corelib/corelib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698