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

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

Issue 10942025: Convert String and List to abstract classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated to tip-of-tree. Created 8 years, 2 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
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 // Note that optimizing compiler depends on the algorithm which returns 5 // Note that optimizing compiler depends on the algorithm which returns
6 // a GrowableObjectArray if length is null, otherwise returns fixed size array. 6 // a GrowableObjectArray if length is null, otherwise returns fixed size array.
7 patch class ListImplementation<E> { 7 patch class List<E> {
8 /* patch */ factory List([int length = null]) { 8 /* patch */ factory List([int length = null]) {
srdjan 2012/09/28 17:52:22 Shouldn't the 'patch' be enabled here, since: ext
Lasse Reichstein Nielsen 2012/09/30 20:46:43 I was informed that the patch parser in the VM doe
9 if (length === null) { 9 if (length === null) {
10 return new GrowableObjectArray<E>(); 10 return new GrowableObjectArray<E>();
11 } else { 11 } else {
12 return new ObjectArray<E>(length); 12 return new ObjectArray<E>(length);
13 } 13 }
14 } 14 }
15
16 /* patch */ static _from(Iterable other) {
17 GrowableObjectArray list = new GrowableObjectArray();
18 for (final e in other) {
19 list.add(e);
20 }
21 return list;
22 }
23 } 15 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698