| 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) { | 5 function native_ListFactory__new(typeToken, length) { |
| 6 return RTT.setTypeInfo( | 6 return RTT.setTypeInfo( |
| 7 new Array(length), | 7 new Array(length), |
| 8 Array.$lookupRTT(RTT.getTypeInfo(typeToken).typeArgs)); | 8 Array.$lookupRTT(RTT.getTypeInfo(typeToken).typeArgs)); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 function native_ListImplementation__add(element) { | 27 function native_ListImplementation__add(element) { |
| 28 this.push(element); | 28 this.push(element); |
| 29 } | 29 } |
| 30 | 30 |
| 31 function $inlineArrayIndexCheck(array, index) { | 31 function $inlineArrayIndexCheck(array, index) { |
| 32 if (index >= 0 && index < array.length) { | 32 if (index >= 0 && index < array.length) { |
| 33 return index; | 33 return index; |
| 34 } | 34 } |
| 35 native__ArrayJsUtil__throwIndexOutOfRangeException(index); | 35 native__ListJsUtil__throwIndexOutOfRangeException(index); |
| 36 } | 36 } |
| 37 | 37 |
| 38 function native_ListImplementation__removeRange(start, length) { | 38 function native_ListImplementation__removeRange(start, length) { |
| 39 this.splice(start, length); | 39 this.splice(start, length); |
| 40 } | 40 } |
| 41 | 41 |
| 42 function native_ListImplementation__insertRange(start, length, initialValue) { | 42 function native_ListImplementation__insertRange(start, length, initialValue) { |
| 43 var array = [start, 0]; | 43 var array = [start, 0]; |
| 44 for (var i = 0; i < length; i++){ | 44 for (var i = 0; i < length; i++){ |
| 45 array.push(initialValue); | 45 array.push(initialValue); |
| 46 } | 46 } |
| 47 this.splice.apply(this, array); | 47 this.splice.apply(this, array); |
| 48 } | 48 } |
| OLD | NEW |