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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_array.dart

Issue 14425003: Make List.remove return boolean. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/list.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_array.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
index ca0121023bfcd4a72404812291d3062c69eb269b..8d7fe061161427a42fc0972fcb84bc92b820a5d2 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
@@ -52,14 +52,15 @@ class JSArray<E> extends Interceptor implements List<E>, JSIndexable {
return JS('var', r'#.pop()', this);
}
- void remove(Object element) {
+ bool remove(Object element) {
checkGrowable(this, 'remove');
for (int i = 0; i < this.length; i++) {
if (this[i] == element) {
JS('var', r'#.splice(#, 1)', this, i);
- return;
+ return true;
}
}
+ return false;
}
void removeWhere(bool test(E element)) {
« no previous file with comments | « sdk/lib/_collection_dev/list.dart ('k') | sdk/lib/collection/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698