Index: sdk/lib/_internal/compiler/implementation/lib/js_array.dart |
=================================================================== |
--- sdk/lib/_internal/compiler/implementation/lib/js_array.dart (revision 15149) |
+++ sdk/lib/_internal/compiler/implementation/lib/js_array.dart (working copy) |
@@ -168,4 +168,13 @@ |
int get hashCode => Primitives.objectHashCode(receiver); |
Type get runtimeType => createRuntimeType('List'); |
+ |
+ int get length => JS('int', r'#.length', this); |
+ |
+ void set length(int newLength) { |
+ if (newLength is !int) throw new ArgumentError(newLength); |
+ if (newLength < 0) throw new RangeError.value(newLength); |
+ checkGrowable(this, 'set length'); |
+ JS('void', r'#.length = #', this, newLength); |
+ } |
} |