Changeset 35814 in webkit
- Timestamp:
- Aug 17, 2008 8:21:46 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r35811 r35814 1 2008-08-17 Timothy Hatcher <timothy@apple.com> 2 3 Complete in scope variables in the Console when paused. 4 5 https://bugs.webkit.org/show_bug.cgi?id=19115 6 7 Reviewed by Geoffrey Garen. 8 9 * page/inspector/Console.js: 10 (WebInspector.Console.prototype.completions): If the expressionString 11 is null or empty and the debugger is paused, call variablesInScopeForSelectedCallFrame 12 to get an object that declares all the in scope variables. That way 13 "top level" expressions are completed. 14 * page/inspector/ScriptsPanel.js: 15 (WebInspector.ScriptsPanel.prototype.variablesInScopeForSelectedCallFrame): 16 Return an object that has all the variables that are in scope for the 17 selected call frame. The value of each property is just true. 18 The return object is useful for quick lookups or auto completion. 19 1 20 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca> 2 21 -
trunk/WebCore/page/inspector/Console.js
r35788 r35814 201 201 return; 202 202 203 var result = InspectorController.inspectedWindow();203 var result; 204 204 if (expressionString) { 205 205 try { … … 208 208 // Do nothing, the prefix will be considered a window property. 209 209 } 210 } else { 211 // There is no expressionString, so the completion should happen against global properties. 212 // Or if the debugger is paused, against properties in scope of the selected call frame. 213 if (WebInspector.panels.scripts.paused) 214 result = WebInspector.panels.scripts.variablesInScopeForSelectedCallFrame(); 215 else 216 result = InspectorController.inspectedWindow(); 210 217 } 211 218 -
trunk/WebCore/page/inspector/ScriptsPanel.js
r34635 r35814 294 294 }, 295 295 296 variablesInScopeForSelectedCallFrame: function() 297 { 298 var selectedCallFrame = this.sidebarPanes.callstack.selectedCallFrame; 299 if (!this._paused || !selectedCallFrame) 300 return {}; 301 302 var result = {}; 303 var scopeChain = selectedCallFrame.scopeChain; 304 for (var i = 0; i < scopeChain.length; ++i) { 305 var scopeObject = scopeChain[i]; 306 for (var property in scopeObject) 307 result[property] = true; 308 } 309 310 return result; 311 }, 312 296 313 debuggerPaused: function() 297 314 {
Note: See TracChangeset
for help on using the changeset viewer.