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

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js

Issue 2371133003: [Devtools] Lazily build reverse mappings (Closed)
Patch Set: Comments were addressed Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
index e08e781569aed211ae02f08f9c0214283a4b3cff..b107648fb2b04471139c6304c5ed06a781a2f0a9 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
@@ -229,10 +229,8 @@ WebInspector.CompilerScriptMapping.prototype = {
this._scriptForSourceMap.set(sourceMap, script);
// Report sources.
- var sourceURLs = sourceMap.sourceURLs();
var missingSources = [];
- for (var i = 0; i < sourceURLs.length; ++i) {
- var sourceURL = sourceURLs[i];
+ for (var sourceURL of sourceMap.sourceURLs()) {
if (this._sourceMapForURL.get(sourceURL))
continue;
this._sourceMapForURL.set(sourceURL, sourceMap);
@@ -363,9 +361,8 @@ WebInspector.CompilerScriptMapping.prototype = {
var script = this._scriptForSourceMap.get(sourceMap);
if (!script)
return;
- var sourceURLs = sourceMap.sourceURLs();
- for (var i = 0; i < sourceURLs.length; ++i) {
- var uiSourceCode = this._networkMapping.uiSourceCodeForScriptURL(sourceURLs[i], script);
+ for (var sourceURL of sourceMap.sourceURLs()) {
+ var uiSourceCode = this._networkMapping.uiSourceCodeForScriptURL(sourceURL, script);
if (uiSourceCode)
this._unbindUISourceCode(uiSourceCode);
}

Powered by Google App Engine
This is Rietveld 408576698