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

Unified Diff: runtime/lib/growable_array.dart

Issue 9007015: Fix issue 920: do not allow length of a list go below 0. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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 | tests/language/src/ListTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/growable_array.dart
===================================================================
--- runtime/lib/growable_array.dart (revision 2646)
+++ runtime/lib/growable_array.dart (working copy)
@@ -163,6 +163,9 @@
}
T removeLast() {
+ if (_length == 0) {
+ throw new IndexOutOfRangeException(-1);
+ }
_length--;
return backingArray[_length];
}
« no previous file with comments | « no previous file | tests/language/src/ListTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698