Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Side by Side Diff: src/js/array.js

Issue 1794233006: Also return the resulting array in GetSortedArrayKeys (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698