Commit 5d14d236 authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

[cleanup] Replace {keysArray} with {keys} plus spread operator

This CL is part of the effort to clean up prototype wrangling in
DevTools's utilities.js. After this CL we are able to remove
{keysArray} from Map.

Bug: chromium:1050549
Change-Id: I59792c1dfb5f2a8c78c3a427e55e5497c33a8afc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2051843Reviewed-by: default avatarTim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740630}
parent 07c1a090
......@@ -10,7 +10,7 @@
let metrics = (await model.requestMetrics()).metrics;
TestRunner.addResult('\nMetrics reported:');
TestRunner.addResults(metrics.keysArray().sort());
TestRunner.addResults([...metrics.keys()].sort());
TestRunner.completeTest();
})();
......@@ -78,7 +78,7 @@
function dumpEditorTabs() {
var editorContainer = UI.panels.sources._sourcesView._editorContainer;
var openedUISourceCodes = editorContainer._tabIds.keysArray();
var openedUISourceCodes = [...editorContainer._tabIds.keys()];
openedUISourceCodes.sort((a, b) => a.url().compareTo(b.url()));
TestRunner.addResult('Opened tabs: ');
for (const code of openedUISourceCodes)
......
......@@ -40,7 +40,7 @@
function dumpEditorTabs() {
var editorContainer = UI.panels.sources._sourcesView._editorContainer;
var openedUISourceCodes = editorContainer._tabIds.keysArray();
var openedUISourceCodes = [...editorContainer._tabIds.keys()];
openedUISourceCodes.sort((a, b) => a.url().compareTo(b.url()));
TestRunner.addResult('Opened tabs: ');
for (const code of openedUISourceCodes)
......
......@@ -29,7 +29,7 @@
function dumpEditorTabs(title) {
var editorContainer = UI.panels.sources._sourcesView._editorContainer;
var openedUISourceCodes = editorContainer._tabIds.keysArray();
var openedUISourceCodes = [...editorContainer._tabIds.keys()];
openedUISourceCodes.sort((a, b) => a.url().compareTo(b.url()));
TestRunner.addResult(title);
for (const code of openedUISourceCodes)
......
......@@ -42,7 +42,7 @@
var debuggerPlugin = SourcesTestRunner.debuggerPlugin(currentFrame);
var decorations = debuggerPlugin._continueToLocationDecorations;
var lines = [];
for (var decoration of decorations.keysArray()) {
for (var decoration of decorations.keys()) {
var find = decoration.find();
var line = find.from.line;
var text = currentFrame.textEditor.line(line).substring(find.from.ch, find.to.ch);
......
......@@ -111,7 +111,7 @@
var debuggerPlugin = SourcesTestRunner.debuggerPlugin(currentFrame);
var decorations = debuggerPlugin._continueToLocationDecorations;
var lines = [];
for (var decoration of decorations.keysArray()) {
for (var decoration of decorations.keys()) {
var find = decoration.find();
var line = find.from.line;
var text = currentFrame.textEditor.line(line).substring(find.from.ch, find.to.ch);
......
......@@ -32,7 +32,7 @@
function didEvaluate() {
dumpConsoleMessageURLs();
TestRunner.addResult('Pre-format row message list:');
TestRunner.addResult(JSON.stringify(sourceFrame._rowMessageBuckets.keysArray()));
TestRunner.addResult(JSON.stringify([...sourceFrame._rowMessageBuckets.keys()]));
var name = panel.visibleView.uiSourceCode().name();
scriptFormatter._toggleFormatScriptSource();
SourcesTestRunner.showScriptSource(name + ':formatted', uiSourceCodeScriptFormatted);
......@@ -42,7 +42,7 @@
dumpConsoleMessageURLs();
TestRunner.addResult('Post-format row message list:');
var formattedSourceFrame = panel.visibleView;
TestRunner.addResult(JSON.stringify(formattedSourceFrame._rowMessageBuckets.keysArray()));
TestRunner.addResult(JSON.stringify([...formattedSourceFrame._rowMessageBuckets.keys()]));
next();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment