Changeset 207784 in webkit
- Timestamp:
- Oct 24, 2016 3:09:29 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207782 r207784 1 2016-10-24 Devin Rousso <dcrousso+webkit@gmail.com> 2 3 Web Inspector: Scope chain shouldn't show empty Closure sections 4 https://bugs.webkit.org/show_bug.cgi?id=152348 5 6 Reviewed by Joseph Pecoraro. 7 8 * inspector/model/scope-chain-node-expected.txt: 9 * inspector/model/scope-chain-node.html: 10 Added "empty" indicators to scopes without any property descriptors. 11 1 12 2016-10-24 Devin Rousso <dcrousso+webkit@gmail.com> 2 13 -
trunk/LayoutTests/inspector/model/scope-chain-node-expected.txt
r198332 r207784 56 56 SCOPE CHAIN: 57 57 Closure 58 (empty) 58 59 FunctionName 59 60 - functionName: function functionName() { 60 61 Closure 62 (empty) 61 63 GlobalLexicalEnvironment 62 64 - lexicalGlobalVariable: 2 … … 66 68 SCOPE CHAIN: 67 69 Closure 70 (empty) 68 71 Block 69 72 - MyClass: class MyClass 70 73 Closure 74 (empty) 71 75 GlobalLexicalEnvironment 72 76 - lexicalGlobalVariable: 2 … … 102 106 - a: 1 103 107 Closure 108 (empty) 104 109 GlobalLexicalEnvironment 105 110 - lexicalGlobalVariable: 2 … … 108 113 SCOPE CHAIN: 109 114 Closure 115 (empty) 110 116 Block 111 117 - MyClass: class MyClass … … 113 119 - a: 1 114 120 Closure 121 (empty) 115 122 GlobalLexicalEnvironment 116 123 - lexicalGlobalVariable: 2 … … 119 126 SCOPE CHAIN: 120 127 Closure 128 (empty) 121 129 Block 122 130 - MyClassWithStaticMethod: class MyClassWithStaticMethod … … 124 132 - a: 1 125 133 Closure 134 (empty) 126 135 GlobalLexicalEnvironment 127 136 - lexicalGlobalVariable: 2 -
trunk/LayoutTests/inspector/model/scope-chain-node.html
r206152 r207784 46 46 for (let {scope, propertyDescriptors} of results) { 47 47 InspectorTest.log(` ${scopeTypeToString(scope.type)}`); 48 if (scope.type !== WebInspector.ScopeChainNode.Type.Global) { 49 for (let descriptor of propertyDescriptors) 50 InspectorTest.log(` - ${descriptor.name}: ${firstLine(descriptor.value.description)}`); 48 if (scope.type === WebInspector.ScopeChainNode.Type.Global) 49 continue; 50 51 if (!propertyDescriptors.length) { 52 InspectorTest.assert(scope.empty, "Scope should be empty if there are no property descriptors."); 53 InspectorTest.log(" (empty)"); 54 continue; 51 55 } 56 57 for (let descriptor of propertyDescriptors) 58 InspectorTest.log(` - ${descriptor.name}: ${firstLine(descriptor.value.description)}`); 52 59 } 53 60 return results; -
trunk/Source/JavaScriptCore/ChangeLog
r207781 r207784 1 2016-10-24 Devin Rousso <dcrousso+webkit@gmail.com> 2 3 Web Inspector: Scope chain shouldn't show empty Closure sections 4 https://bugs.webkit.org/show_bug.cgi?id=152348 5 6 Reviewed by Joseph Pecoraro. 7 8 * inspector/InjectedScriptSource.js: 9 (isEmptyObject): 10 (InjectedScript.CallFrameProxy._createScopeJson): 11 If the scope object has no properties, set empty to true. 12 13 * inspector/protocol/Debugger.json: 14 Added empty property to Scope type. 15 1 16 2016-10-24 Keith Miller <keith_miller@apple.com> 2 17 -
trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js
r207229 r207784 69 69 } 70 70 71 function isEmptyObject(object) 72 { 73 for (let key in object) 74 return false; 75 return true; 76 } 77 71 78 var InjectedScript = function() 72 79 { … … 1336 1343 InjectedScript.CallFrameProxy._createScopeJson = function(object, {name, type, location}, groupId) 1337 1344 { 1338 varscope = {1345 let scope = { 1339 1346 object: injectedScript._wrapObject(object, groupId), 1340 1347 type: InjectedScript.CallFrameProxy._scopeTypeNames[type], … … 1343 1350 if (name) 1344 1351 scope.name = name; 1352 1345 1353 if (location) 1346 1354 scope.location = location; 1355 1356 if (isEmptyObject(object)) 1357 scope.empty = true; 1347 1358 1348 1359 return scope; -
trunk/Source/JavaScriptCore/inspector/protocol/Debugger.json
r207444 r207784 85 85 { "name": "type", "type": "string", "enum": ["global", "with", "closure", "catch", "functionName", "globalLexicalEnvironment", "nestedLexical"], "description": "Scope type." }, 86 86 { "name": "name", "type": "string", "optional": true, "description": "Name associated with the scope." }, 87 { "name": "location", "$ref": "Location", "optional": true, "description": "Location if available of the scope definition." } 87 { "name": "location", "$ref": "Location", "optional": true, "description": "Location if available of the scope definition." }, 88 { "name": "empty", "type": "boolean", "optional": true, "description": "Whether the scope has any variables." } 88 89 ], 89 90 "description": "Scope description." -
trunk/Source/WebInspectorUI/ChangeLog
r207782 r207784 1 2016-10-24 Devin Rousso <dcrousso+webkit@gmail.com> 2 3 Web Inspector: Scope chain shouldn't show empty Closure sections 4 https://bugs.webkit.org/show_bug.cgi?id=152348 5 6 Reviewed by Joseph Pecoraro. 7 8 * UserInterface/Controllers/DebuggerManager.js: 9 (WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload): 10 * UserInterface/Models/ScopeChainNode.js: 11 (WebInspector.ScopeChainNode): 12 (WebInspector.ScopeChainNode.prototype.get empty): 13 Added support for new empty property. 14 15 * UserInterface/Views/ScopeChainDetailsSidebarPanel.js: 16 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection): 17 Only create and display a DetailsSection if the scope is not empty (via empty). 18 1 19 2016-10-24 Devin Rousso <dcrousso+webkit@gmail.com> 2 20 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
r207444 r207784 687 687 } 688 688 689 varobject = WebInspector.RemoteObject.fromPayload(payload.object);690 return new WebInspector.ScopeChainNode(type, [object], payload.name, payload.location );689 let object = WebInspector.RemoteObject.fromPayload(payload.object); 690 return new WebInspector.ScopeChainNode(type, [object], payload.name, payload.location, payload.empty); 691 691 } 692 692 -
trunk/Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js
r202717 r207784 26 26 WebInspector.ScopeChainNode = class ScopeChainNode extends WebInspector.Object 27 27 { 28 constructor(type, objects, name, location )28 constructor(type, objects, name, location, empty) 29 29 { 30 30 super(); … … 40 40 this._name = name || ""; 41 41 this._location = location || null; 42 this._empty = empty || false; 42 43 } 43 44 … … 48 49 get name() { return this._name; } 49 50 get location() { return this._location; } 51 get empty() { return this._empty; } 50 52 51 53 get hash() -
trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js
r204513 r207784 169 169 let scopeChain = callFrame.mergedScopeChain(); 170 170 for (let scope of scopeChain) { 171 // Don't show sections for empty scopes unless it is the local scope, since it has "this". 172 if (scope.empty && scope.type !== WebInspector.ScopeChainNode.Type.Local) 173 continue; 174 171 175 let title = null; 172 176 let extraPropertyDescriptor = null;
Note: See TracChangeset
for help on using the changeset viewer.