| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 function native_ListFactory__new(typeToken, length) { | |
| 6 return RTT.setTypeInfo( | |
| 7 new Array(length), | |
| 8 Array.$lookupRTT(RTT.getTypeInfo(typeToken).typeArgs)); | |
| 9 } | |
| 10 | |
| 11 function native_ListImplementation_INDEX(index) { | 5 function native_ListImplementation_INDEX(index) { |
| 12 var i = index | 0; | 6 var i = index | 0; |
| 13 if (i !== index) { | 7 if (i !== index) { |
| 14 native__NumberJsUtil__throwIllegalArgumentException(index); | 8 native__NumberJsUtil__throwIllegalArgumentException(index); |
| 15 } else if (i < 0 || i >= this.length) { | 9 } else if (i < 0 || i >= this.length) { |
| 16 native__ListJsUtil__throwIndexOutOfRangeException(index); | 10 native__ListJsUtil__throwIndexOutOfRangeException(index); |
| 17 } | 11 } |
| 18 return this[i]; | 12 return this[i]; |
| 19 } | 13 } |
| 20 | 14 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 48 |
| 55 function $inlineArrayIndexCheck(array, index) { | 49 function $inlineArrayIndexCheck(array, index) { |
| 56 var i = index | 0; | 50 var i = index | 0; |
| 57 if (i !== index) { | 51 if (i !== index) { |
| 58 native__NumberJsUtil__throwIllegalArgumentException(index); | 52 native__NumberJsUtil__throwIllegalArgumentException(index); |
| 59 } else if (i < 0 || i >= array.length) { | 53 } else if (i < 0 || i >= array.length) { |
| 60 native__ListJsUtil__throwIndexOutOfRangeException(index); | 54 native__ListJsUtil__throwIndexOutOfRangeException(index); |
| 61 } | 55 } |
| 62 return i; | 56 return i; |
| 63 } | 57 } |
| OLD | NEW |