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

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

Issue 345223003: Add VM internal Dart class 'ClassID' used to manage class-ids of known classes. Next CL: add consta… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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/double_patch.dart ('k') | runtime/lib/internal_sources.gypi » ('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 class _GrowableList<T> implements List<T> { 5 class _GrowableList<T> implements List<T> {
6 static final int _classId = (new _GrowableList(0))._cid; 6 static final int _classId = ClassID.getID(new _GrowableList(0));
7 7
8 void insert(int index, T element) { 8 void insert(int index, T element) {
9 if (index < 0 || index > length) { 9 if (index < 0 || index > length) {
10 throw new RangeError.range(index, 0, length); 10 throw new RangeError.range(index, 0, length);
11 } 11 }
12 if (index == this.length) { 12 if (index == this.length) {
13 add(element); 13 add(element);
14 return; 14 return;
15 } 15 }
16 int oldLength = this.length; 16 int oldLength = this.length;
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 } 340 }
341 341
342 Set<T> toSet() { 342 Set<T> toSet() {
343 return new Set<T>.from(this); 343 return new Set<T>.from(this);
344 } 344 }
345 345
346 Map<int, T> asMap() { 346 Map<int, T> asMap() {
347 return IterableMixinWorkaround.asMapList(this); 347 return IterableMixinWorkaround.asMapList(this);
348 } 348 }
349 } 349 }
OLDNEW
« no previous file with comments | « runtime/lib/double_patch.dart ('k') | runtime/lib/internal_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698