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

Unified Diff: third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js

Issue 2163093003: [DevTools] Remove Object.values and Object.isEmpty from utilities.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/snippets/ScriptSnippetModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
index 15e04152973af2ea073e2834b5c1e3359bdbc924..b771ffd8ecd29ffe6ed3ba1f52adad1a427697f1 100644
--- a/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
@@ -96,9 +96,8 @@ WebInspector.ScriptSnippetModel.prototype = {
_loadSnippets: function()
{
- var snippets = this._snippetStorage.snippets();
- for (var i = 0; i < snippets.length; ++i)
- this._addScriptSnippet(snippets[i]);
+ for (var snippet of this._snippetStorage.snippets())
+ this._addScriptSnippet(snippet);
},
/**
@@ -146,6 +145,8 @@ WebInspector.ScriptSnippetModel.prototype = {
return;
var snippetId = this._snippetIdForUISourceCode.get(uiSourceCode) || "";
var snippet = this._snippetStorage.snippetForId(snippetId);
+ if (!snippet)
+ return;
this._snippetStorage.deleteSnippet(snippet);
this._removeBreakpoints(uiSourceCode);
this._releaseSnippetScript(uiSourceCode);

Powered by Google App Engine
This is Rietveld 408576698