OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils, extrasUtils) { | 5 (function(global, utils, extrasUtils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 if (IS_NUMBER(indices)) { | 81 if (IS_NUMBER(indices)) { |
82 var keys = new InternalArray(); | 82 var keys = new InternalArray(); |
83 // It's an interval | 83 // It's an interval |
84 var limit = indices; | 84 var limit = indices; |
85 for (var i = 0; i < limit; ++i) { | 85 for (var i = 0; i < limit; ++i) { |
86 var e = array[i]; | 86 var e = array[i]; |
87 if (!IS_UNDEFINED(e) || i in array) { | 87 if (!IS_UNDEFINED(e) || i in array) { |
88 keys.push(i); | 88 keys.push(i); |
89 } | 89 } |
90 } | 90 } |
| 91 return keys; |
91 } | 92 } |
92 return InnerArraySort(indices, indices.length, KeySortCompare); | 93 return InnerArraySort(indices, indices.length, KeySortCompare); |
93 } | 94 } |
94 | 95 |
95 | 96 |
96 function SparseJoinWithSeparatorJS(array, keys, length, convert, separator) { | 97 function SparseJoinWithSeparatorJS(array, keys, length, convert, separator) { |
97 var keys_length = keys.length; | 98 var keys_length = keys.length; |
98 var elements = new InternalArray(keys_length * 2); | 99 var elements = new InternalArray(keys_length * 2); |
99 for (var i = 0; i < keys_length; i++) { | 100 for (var i = 0; i < keys_length; i++) { |
100 var key = keys[i]; | 101 var key = keys[i]; |
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1960 %InstallToContext([ | 1961 %InstallToContext([ |
1961 "array_pop", ArrayPop, | 1962 "array_pop", ArrayPop, |
1962 "array_push", ArrayPush, | 1963 "array_push", ArrayPush, |
1963 "array_shift", ArrayShift, | 1964 "array_shift", ArrayShift, |
1964 "array_splice", ArraySplice, | 1965 "array_splice", ArraySplice, |
1965 "array_slice", ArraySlice, | 1966 "array_slice", ArraySlice, |
1966 "array_unshift", ArrayUnshift, | 1967 "array_unshift", ArrayUnshift, |
1967 ]); | 1968 ]); |
1968 | 1969 |
1969 }); | 1970 }); |
OLD | NEW |