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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js

Issue 2122423002: [DevTools] Remove functionDetails from protocol.json (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-generator-details-from-protocol
Patch Set: a 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/platform/v8_inspector/InjectedScriptSource.js
diff --git a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
index 743cc06fa5511fabba8704502d7eaefdfc2a930a..e088703c57694a9eb8a04890d069698eaad739b7 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js
@@ -199,6 +199,20 @@ InjectedScript.primitiveTypes = {
__proto__: null
}
+/**
+ * @type {!Map<string, string>}
+ * @const
+ */
+InjectedScript.closureTypes = new Map([
+ ["local", "Local"],
+ ["closure", "Closure"],
+ ["catch", "Catch"],
+ ["block", "Block"],
+ ["script", "Script"],
+ ["with", "With Block"],
+ ["global", "Global"]
+]);
+
InjectedScript.prototype = {
/**
* @param {*} object
@@ -347,6 +361,10 @@ InjectedScript.prototype = {
*/
getProperties: function(object, objectGroupName, ownProperties, accessorPropertiesOnly, generatePreview)
{
+ var subtype = this._subtype(object);
+ if (subtype === "internal#scope")
+ object = object.object;
dgozman 2016/07/07 19:59:23 This needs a justification.
kozy 2016/07/07 22:59:08 Added comment.
+
var descriptors = [];
var iter = this._propertyDescriptors(object, ownProperties, accessorPropertiesOnly, undefined);
// Go over properties, wrap object values.
@@ -650,6 +668,12 @@ InjectedScript.prototype = {
return this._describeIncludingPrimitives(obj.value);
}
+ if (subtype === "internal#scopes")
dgozman 2016/07/07 19:59:23 scopeList
kozy 2016/07/07 22:59:08 Done.
+ return "Scopes[" + obj.length + "]";
+
+ if (subtype === "internal#scope")
+ return (InjectedScript.closureTypes.get(obj.type) || "Unknown") + (obj.name ? "(" + obj.name + ")" : "");
dgozman 2016/07/07 19:59:23 maybe space before "(" ?
kozy 2016/07/07 22:59:08 Done.
+
return className;
},

Powered by Google App Engine
This is Rietveld 408576698