Skip to content

Commit

Permalink
DevTools: [Console] speedup array autocompletion
Browse files Browse the repository at this point in the history
The patch avoids serializing array indexes in getCompletions
function.

BUG=585877
R=pfeldman, kozyatinskiy

Review URL: https://codereview.chromium.org/1685683006

Cr-Commit-Position: refs/heads/master@{#374801}
  • Loading branch information
aslushnikov authored and Commit bot committed Feb 11, 2016
1 parent 0eda8b1 commit 5315df4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion front_end/sdk/RuntimeModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,13 @@ WebInspector.ExecutionContext.prototype = {
if (type === "array" && o === object && ArrayBuffer.isView(o) && o.length > 9999)
continue;
var names = Object.getOwnPropertyNames(o);
for (var i = 0; i < names.length; ++i)
var isArray = Array.isArray(o);
for (var i = 0; i < names.length; ++i) {
// Skip array elements indexes.
if (isArray && /^[0-9]/.test(names[i]))
continue;
resultSet[names[i]] = true;
}
} catch (e) {
}
}
Expand Down

0 comments on commit 5315df4

Please sign in to comment.