Index: pkg/dev_compiler/tool/input_sdk/private/js_array.dart |
diff --git a/pkg/dev_compiler/tool/input_sdk/private/js_array.dart b/pkg/dev_compiler/tool/input_sdk/private/js_array.dart |
index e92230aff536b93ed15205ea3f385ac1dbb3933f..2d4d0b481e9f69e79744071c09cf45315f035623 100644 |
--- a/pkg/dev_compiler/tool/input_sdk/private/js_array.dart |
+++ b/pkg/dev_compiler/tool/input_sdk/private/js_array.dart |
@@ -15,27 +15,20 @@ class JSArray<E> implements List<E>, JSIndexable<E> { |
const JSArray(); |
/** |
- * Constructor for adding type parameters to an existing JavaScript Array. |
- */ |
- factory JSArray.typed(allocation) => |
- // TODO(jmesserly): skip this when E is dynamic and Object. |
- JS('-dynamic', 'dart.list(#, #)', allocation, E); |
- |
- /** |
* Constructor for adding type parameters to an existing JavaScript |
* Array. Used for creating literal lists. |
*/ |
factory JSArray.of(allocation) { |
// TODO(sra): Move this to core.List for better readability. |
// Capture the parameterized ES6 'JSArray' class. |
- return JS('-dynamic', 'dart.setType(#, JSArray)', allocation); |
+ return dart.setType(allocation, JS('', 'JSArray')); |
Leaf
2017/07/26 00:46:31
This change caused a dart._check to be added here,
Jennifer Messerly
2017/07/26 01:23:00
oh shoot, I thought I'd fixed that before landing
Jennifer Messerly
2017/07/26 01:33:47
fixed in https://codereview.chromium.org/298506300
|
} |
// TODO(jmesserly): consider a fixed array subclass instead. |
factory JSArray.markFixed(allocation) => |
- new JSArray<E>.typed(markFixedList(allocation)); |
+ new JSArray<E>.of(markFixedList(allocation)); |
- factory JSArray.markGrowable(allocation) = JSArray<E>.typed; |
+ factory JSArray.markGrowable(allocation) = JSArray<E>.of; |
static List markFixedList(List list) { |
// Functions are stored in the hidden class and not as properties in |
@@ -327,7 +320,7 @@ class JSArray<E> implements List<E>, JSIndexable<E> { |
} |
} |
if (start == end) return <E>[]; |
- return new JSArray<E>.typed(JS('', r'#.slice(#, #)', this, start, end)); |
+ return new JSArray<E>.of(JS('', r'#.slice(#, #)', this, start, end)); |
} |
Iterable<E> getRange(int start, int end) { |
@@ -532,7 +525,7 @@ class JSArray<E> implements List<E>, JSIndexable<E> { |
List<E> toList({bool growable: true}) { |
var list = JS('', '#.slice()', this); |
if (!growable) markFixedList(list); |
- return new JSArray<E>.typed(list); |
+ return new JSArray<E>.of(list); |
} |
Set<E> toSet() => new Set<E>.from(this); |
@@ -583,7 +576,8 @@ class JSArray<E> implements List<E>, JSIndexable<E> { |
return new ListMapView<E>(this); |
} |
- Type get runtimeType => wrapType(JS('', '#(#)', getGenericClass(List), E)); |
+ Type get runtimeType => |
+ dart.wrapType(JS('', '#(#)', dart.getGenericClass(List), E)); |
} |
/** |