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

Side by Side Diff: runtime/lib/array.dart

Issue 11564029: Implement Function.apply in vm (issue 5670). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/function.cc » ('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(int length) native "ObjectArray_allocate"; 9 factory _ObjectArray(int length) native "ObjectArray_allocate";
10 10
(...skipping 15 matching lines...) Expand all
26 26
27 E removeAt(int index) { 27 E removeAt(int index) {
28 throw new UnsupportedError( 28 throw new UnsupportedError(
29 "Cannot remove element of a non-extendable array"); 29 "Cannot remove element of a non-extendable array");
30 } 30 }
31 31
32 void setRange(int start, int length, List<E> from, [int startFrom = 0]) { 32 void setRange(int start, int length, List<E> from, [int startFrom = 0]) {
33 if (length < 0) { 33 if (length < 0) {
34 throw new ArgumentError("negative length $length"); 34 throw new ArgumentError("negative length $length");
35 } 35 }
36 if (from is _ObjectArray) { 36 if (from is _ObjectArray) {
37 _copyFromObjectArray(from, startFrom, start, length); 37 _copyFromObjectArray(from, startFrom, start, length);
38 } else { 38 } else {
39 Arrays.copy(from, startFrom, this, start, length); 39 Arrays.copy(from, startFrom, this, start, length);
40 } 40 }
41 } 41 }
42 42
43 void removeRange(int start, int length) { 43 void removeRange(int start, int length) {
44 throw new UnsupportedError( 44 throw new UnsupportedError(
45 "Cannot remove range of a non-extendable array"); 45 "Cannot remove range of a non-extendable array");
46 } 46 }
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 if (!hasNext) { 315 if (!hasNext) {
316 throw new StateError("No more elements"); 316 throw new StateError("No more elements");
317 } 317 }
318 return _array[_pos++]; 318 return _array[_pos++];
319 } 319 }
320 320
321 final List<E> _array; 321 final List<E> _array;
322 final int _length; // Cache array length for faster access. 322 final int _length; // Cache array length for faster access.
323 int _pos; 323 int _pos;
324 } 324 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698