| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 function native_ListImplementation_INDEX(index) { |
| 6 var i = index | 0; |
| 7 if (i !== index) { |
| 8 native__NumberJsUtil__throwIllegalArgumentException(index); |
| 9 } else if (i < 0 || i >= this.length) { |
| 10 native__ListJsUtil__throwIndexOutOfRangeException(index); |
| 11 } |
| 12 return this[i]; |
| 13 } |
| 14 |
| 15 function native_ListImplementation_ASSIGN_INDEX(index, value) { |
| 16 var i = index | 0; |
| 17 if (i !== index) { |
| 18 native__NumberJsUtil__throwIllegalArgumentException(index); |
| 19 } else if (i < 0 || i >= this.length) { |
| 20 native__ListJsUtil__throwIndexOutOfRangeException(index); |
| 21 } |
| 22 this[i] = value; |
| 23 } |
| 24 |
| 25 function native_ListImplementation_get$length() { |
| 26 return this.length; |
| 27 } |
| 28 |
| 29 function native_ListImplementation__setLength(length) { |
| 30 this.length = length; |
| 31 } |
| 32 |
| 33 function native_ListImplementation__add(element) { |
| 34 this.push(element); |
| 35 } |
| 36 |
| 37 function native_ListImplementation__removeRange(start, length) { |
| 38 this.splice(start, length); |
| 39 } |
| 40 |
| 41 function native_ListImplementation__insertRange(start, length, initialValue) { |
| 42 var array = [start, 0]; |
| 43 for (var i = 0; i < length; i++){ |
| 44 array.push(initialValue); |
| 45 } |
| 46 this.splice.apply(this, array); |
| 47 } |
| 48 |
| 49 function $inlineArrayIndexCheck(array, index) { |
| 50 var i = index | 0; |
| 51 if (i !== index) { |
| 52 native__NumberJsUtil__throwIllegalArgumentException(index); |
| 53 } else if (i < 0 || i >= array.length) { |
| 54 native__ListJsUtil__throwIndexOutOfRangeException(index); |
| 55 } |
| 56 return i; |
| 57 } |
| OLD | NEW |