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

Side by Side Diff: runtime/lib/typeddata.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 | « runtime/lib/growable_array.dart ('k') | sdk/lib/_collection_dev/list.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // patch classes for Int8List ..... Float64List and ByteData implementations. 5 // patch classes for Int8List ..... Float64List and ByteData implementations.
6 6
7 patch class Int8List { 7 patch class Int8List {
8 /* patch */ factory Int8List(int length) { 8 /* patch */ factory Int8List(int length) {
9 return new _Int8Array(length); 9 return new _Int8Array(length);
10 } 10 }
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 void add(value) { 366 void add(value) {
367 throw new UnsupportedError( 367 throw new UnsupportedError(
368 "Cannot add to a non-extendable array"); 368 "Cannot add to a non-extendable array");
369 } 369 }
370 370
371 void addAll(Iterable value) { 371 void addAll(Iterable value) {
372 throw new UnsupportedError( 372 throw new UnsupportedError(
373 "Cannot add to a non-extendable array"); 373 "Cannot add to a non-extendable array");
374 } 374 }
375 375
376 void insert(int index, value) {
377 throw new UnsupportedError(
378 "Cannot insert into a non-extendable array");
379 }
380
381 void insertAll(int index, Iterable values) {
382 throw new UnsupportedError(
383 "Cannot insert into a non-extendable array");
384 }
385
376 void sort([int compare(var a, var b)]) { 386 void sort([int compare(var a, var b)]) {
377 return IterableMixinWorkaround.sortList(this, compare); 387 return IterableMixinWorkaround.sortList(this, compare);
378 } 388 }
379 389
380 int indexOf(element, [int start = 0]) { 390 int indexOf(element, [int start = 0]) {
381 return IterableMixinWorkaround.indexOfList(this, element, start); 391 return IterableMixinWorkaround.indexOfList(this, element, start);
382 } 392 }
383 393
384 int lastIndexOf(element, [int start = null]) { 394 int lastIndexOf(element, [int start = null]) {
385 return IterableMixinWorkaround.lastIndexOfList(this, element, start); 395 return IterableMixinWorkaround.lastIndexOfList(this, element, start);
386 } 396 }
387 397
388 void clear() { 398 void clear() {
389 throw new UnsupportedError( 399 throw new UnsupportedError(
390 "Cannot remove from a non-extendable array"); 400 "Cannot remove from a non-extendable array");
391 } 401 }
392 402
393 int removeLast() { 403 int removeLast() {
394 throw new UnsupportedError( 404 throw new UnsupportedError(
395 "Cannot remove from a non-extendable array"); 405 "Cannot remove from a non-extendable array");
396 } 406 }
397 407
398 void remove(Object element) { 408 bool remove(Object element) {
399 throw new UnsupportedError( 409 throw new UnsupportedError(
400 "Cannot remove from a non-extendable array"); 410 "Cannot remove from a non-extendable array");
401 } 411 }
412
413 bool removeAt(int index) {
414 throw new UnsupportedError(
415 "Cannot remove from a non-extendable array");
416 }
402 417
403 void removeAll(Iterable elements) { 418 void removeAll(Iterable elements) {
404 throw new UnsupportedError( 419 throw new UnsupportedError(
405 "Cannot remove from a non-extendable array"); 420 "Cannot remove from a non-extendable array");
406 } 421 }
407 422
408 void retainAll(Iterable elements) { 423 void retainAll(Iterable elements) {
409 throw new UnsupportedError( 424 throw new UnsupportedError(
410 "Cannot remove from a non-extendable array"); 425 "Cannot remove from a non-extendable array");
411 } 426 }
(...skipping 2770 matching lines...) Expand 10 before | Expand all | Expand 10 after
3182 return value; 3197 return value;
3183 } 3198 }
3184 return object; 3199 return object;
3185 } 3200 }
3186 3201
3187 3202
3188 void _throwRangeError(int index, int length) { 3203 void _throwRangeError(int index, int length) {
3189 String message = "$index must be in the range [0..$length)"; 3204 String message = "$index must be in the range [0..$length)";
3190 throw new RangeError(message); 3205 throw new RangeError(message);
3191 } 3206 }
OLDNEW
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | sdk/lib/_collection_dev/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698