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

Unified Diff: Source/devtools/front_end/network/RequestJSONView.js

Issue 344443003: DevTools: Code fixes for the Closure compiler roll (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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: Source/devtools/front_end/network/RequestJSONView.js
diff --git a/Source/devtools/front_end/network/RequestJSONView.js b/Source/devtools/front_end/network/RequestJSONView.js
index 1f006dd2b5c4df9246b13bc75affd6b13090d670..02abb036aa924f34d464bb5afdcbd607458c9e51 100644
--- a/Source/devtools/front_end/network/RequestJSONView.js
+++ b/Source/devtools/front_end/network/RequestJSONView.js
@@ -41,6 +41,10 @@ WebInspector.RequestJSONView = function(request, parsedJSON)
this.element.classList.add("json");
}
+/**
+ * @param {string} text
+ * @return {?WebInspector.ParsedJSON}
+ */
WebInspector.RequestJSONView.parseJSON = function(text)
{
var prefix = "";
@@ -55,17 +59,21 @@ WebInspector.RequestJSONView.parseJSON = function(text)
try {
return new WebInspector.ParsedJSON(JSON.parse(text), prefix, "");
} catch (e) {
- return;
+ return null;
}
}
+/**
+ * @param {string} text
+ * @return {?WebInspector.ParsedJSON}
+ */
WebInspector.RequestJSONView.parseJSONP = function(text)
{
// Taking everything between first and last parentheses
var start = text.indexOf("(");
var end = text.lastIndexOf(")");
if (start == -1 || end == -1 || end < start)
- return;
+ return null;
var prefix = text.substring(0, start + 1);
var suffix = text.substring(end);
@@ -74,7 +82,7 @@ WebInspector.RequestJSONView.parseJSONP = function(text)
try {
return new WebInspector.ParsedJSON(JSON.parse(text), prefix, suffix);
} catch (e) {
- return;
+ return null;
}
}

Powered by Google App Engine
This is Rietveld 408576698