Index: sdk/lib/_internal/compiler/implementation/lib/js_array.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart |
index cbdacad46eaf946ecd0fc132b702d6362648cb4c..282fb78c7af17c93a6da08d8f2eeecb860ffd46f 100644 |
--- a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart |
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart |
@@ -27,6 +27,15 @@ class JSArray<E> implements List<E>, JSIndexable { |
return JS('var', r'#.splice(#, 1)[0]', this, index); |
} |
+ void insert(int index, E value) { |
+ if (index is !int) throw new ArgumentError(index); |
+ if (index < 0 || index > length) { |
+ throw new RangeError.value(index); |
+ } |
+ checkGrowable(this, 'insert'); |
+ JS('void', r'#.splice(#, 0, #)', this, index, value); |
+ } |
+ |
E removeLast() { |
checkGrowable(this, 'removeLast'); |
if (length == 0) throw new RangeError.value(-1); |