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

Side by Side Diff: runtime/lib/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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/growable_array.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 5
6 // TODO(srdjan): Use shared array implementation. 6 // TODO(srdjan): Use shared array implementation.
7 class _ObjectArray<E> implements List<E> { 7 class _ObjectArray<E> implements List<E> {
8 8
9 factory _ObjectArray(length) native "ObjectArray_allocate"; 9 factory _ObjectArray(length) native "ObjectArray_allocate";
10 10
(...skipping 25 matching lines...) Expand all
36 36
37 void setAll(int index, Iterable<E> iterable) { 37 void setAll(int index, Iterable<E> iterable) {
38 IterableMixinWorkaround.setAllList(this, index, iterable); 38 IterableMixinWorkaround.setAllList(this, index, iterable);
39 } 39 }
40 40
41 E removeAt(int index) { 41 E removeAt(int index) {
42 throw new UnsupportedError( 42 throw new UnsupportedError(
43 "Cannot remove element of a non-extendable array"); 43 "Cannot remove element of a non-extendable array");
44 } 44 }
45 45
46 void remove(Object element) { 46 bool remove(Object element) {
47 throw new UnsupportedError( 47 throw new UnsupportedError(
48 "Cannot remove element of a non-extendable array"); 48 "Cannot remove element of a non-extendable array");
49 } 49 }
50 50
51 void removeWhere(bool test(E element)) { 51 void removeWhere(bool test(E element)) {
52 throw new UnsupportedError( 52 throw new UnsupportedError(
53 "Cannot remove element of a non-extendable array"); 53 "Cannot remove element of a non-extendable array");
54 } 54 }
55 55
56 void retainWhere(bool test(E element)) { 56 void retainWhere(bool test(E element)) {
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 void setAll(int index, Iterable<E> iterable) { 303 void setAll(int index, Iterable<E> iterable) {
304 throw new UnsupportedError( 304 throw new UnsupportedError(
305 "Cannot modify an immutable array"); 305 "Cannot modify an immutable array");
306 } 306 }
307 307
308 E removeAt(int index) { 308 E removeAt(int index) {
309 throw new UnsupportedError( 309 throw new UnsupportedError(
310 "Cannot modify an immutable array"); 310 "Cannot modify an immutable array");
311 } 311 }
312 312
313 void remove(Object element) { 313 bool remove(Object element) {
314 throw new UnsupportedError( 314 throw new UnsupportedError(
315 "Cannot modify an immutable array"); 315 "Cannot modify an immutable array");
316 } 316 }
317 317
318 void removeWhere(bool test(E element)) { 318 void removeWhere(bool test(E element)) {
319 throw new UnsupportedError( 319 throw new UnsupportedError(
320 "Cannot modify an immutable array"); 320 "Cannot modify an immutable array");
321 } 321 }
322 322
323 void retainWhere(bool test(E element)) { 323 void retainWhere(bool test(E element)) {
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 } 543 }
544 _position = _length; 544 _position = _length;
545 _current = null; 545 _current = null;
546 return false; 546 return false;
547 } 547 }
548 548
549 E get current { 549 E get current {
550 return _current; 550 return _current;
551 } 551 }
552 } 552 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698