Index: runtime/lib/array_patch.dart |
diff --git a/runtime/lib/array_patch.dart b/runtime/lib/array_patch.dart |
index da5bf73839a3c447543a694c44f5e367c7f9e662..635b46075ed57c784eef6a5ccea6a4cdda30ca76 100644 |
--- a/runtime/lib/array_patch.dart |
+++ b/runtime/lib/array_patch.dart |
@@ -6,15 +6,16 @@ |
// returns a _GrowableObjectArray if length is null, otherwise returns |
// fixed size array. |
patch class List<E> { |
- /* patch */ factory List([int length = 0]) { |
+ /* patch */ factory List([int length]) { |
+ if (!?length) return new _GrowableObjectArray<E>(0); |
if ((length is! int) || (length < 0)) { |
Ivan Posva
2013/02/27 18:14:36
Why do we still do manual type checking here?
floitsch
2013/02/28 09:41:58
1) because we didn't go through code to remove che
|
_throwArgumentError(length); |
} |
- _GrowableObjectArray<E> result = new _GrowableObjectArray<E>(length); |
+ _ObjectArray<E> result = new _ObjectArray<E>(length); |
return result; |
} |
- /* patch */ factory List.fixedLength(int length, {E fill: null}) { |
+ /* patch */ factory List.filled(int length, E fill) { |
if ((length is! int) || (length < 0)) { |
_throwArgumentError(length); |
} |