Chromium Code Reviews| 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; |
| }, |