Changeset 83434 in webkit
- Timestamp:
- Apr 11, 2011 4:45:08 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83429 r83434 1 2011-04-11 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: refactor / document call frames in debugger domain. 6 https://bugs.webkit.org/show_bug.cgi?id=58187 7 8 Note that we are not special casing with(element) and with(document) anymore 9 and do not tell user that it is "Event target" and "Event document". Strictly speaking, 10 we should not have done it for with(element) not necessarily being related to an event. 11 12 * English.lproj/localizedStrings.js: 13 * inspector/InjectedScriptSource.js: 14 * inspector/Inspector.json: 15 * inspector/front-end/ScopeChainSidebarPane.js: 16 (WebInspector.ScopeChainSidebarPane.prototype.update): 17 1 18 2011-04-10 ChangSeok Oh <shivamidow@gmail.com> 2 19 -
trunk/Source/WebCore/inspector/InjectedScriptSource.js
r83290 r83434 300 300 return false; 301 301 302 injectedScript.releaseObjectGroup("backtrace");303 302 var result = []; 304 303 var depth = 0; … … 488 487 const CLOSURE_SCOPE = 3; 489 488 const CATCH_SCOPE = 4; 490 489 490 var scopeTypeNames = {}; 491 scopeTypeNames[GLOBAL_SCOPE] = "global"; 492 scopeTypeNames[LOCAL_SCOPE] = "local"; 493 scopeTypeNames[WITH_SCOPE] = "with"; 494 scopeTypeNames[CLOSURE_SCOPE] = "closure"; 495 scopeTypeNames[CATCH_SCOPE] = "catch"; 496 491 497 var scopeChain = callFrame.scopeChain; 492 498 var scopeChainProxy = []; 493 499 var foundLocalScope = false; 494 500 for (var i = 0; i < scopeChain.length; i++) { 501 var scope = {}; 502 scope.object = injectedScript._wrapObject(scopeChain[i], "backtrace"); 503 495 504 var scopeType = callFrame.scopeType(i); 496 var scopeObject = scopeChain[i]; 497 var scopeObjectProxy = injectedScript._wrapObject(scopeObject, "backtrace"); 498 499 switch(scopeType) { 500 case LOCAL_SCOPE: { 501 foundLocalScope = true; 502 scopeObjectProxy.isLocal = true; 503 scopeObjectProxy.thisObject = injectedScript._wrapObject(callFrame.thisObject, "backtrace"); 504 break; 505 } 506 case CLOSURE_SCOPE: { 507 scopeObjectProxy.isClosure = true; 508 break; 509 } 510 case WITH_SCOPE: 511 case CATCH_SCOPE: { 512 if (foundLocalScope && scopeObject instanceof inspectedWindow.Element) 513 scopeObjectProxy.isElement = true; 514 else if (foundLocalScope && scopeObject instanceof inspectedWindow.Document) 515 scopeObjectProxy.isDocument = true; 516 else 517 scopeObjectProxy.isWithBlock = true; 518 break; 519 } 520 } 521 scopeChainProxy.push(scopeObjectProxy); 505 scope.type = scopeTypeNames[scopeType]; 506 507 if (scopeType === LOCAL_SCOPE) 508 scope.this = injectedScript._wrapObject(callFrame.thisObject, "backtrace"); 509 510 scopeChainProxy.push(scope); 522 511 } 523 512 return scopeChainProxy; -
trunk/Source/WebCore/inspector/Inspector.json
r83290 r83434 1241 1241 "type": "object", 1242 1242 "properties": { 1243 "id": { "type": "string", "description": "Call frame identifier " },1243 "id": { "type": "string", "description": "Call frame identifier." }, 1244 1244 "functionName": { "type": "string", "description": "Name of the function called on this frame." }, 1245 1245 "location": { "$ref": "Location", "description": "Location in the source code." }, 1246 "scopeChain": { "type": "array", "items": { "type": "object" }, "description": "Scope chain for given call frame. // FIXME" } 1246 "scopeChain": { "type": "array", "items": { "$ref": "Scope" }, "description": "Scope chain for given call frame." } 1247 }, 1248 "description": "Debugger call frame. Array of call frames form call stack." 1249 }, 1250 { 1251 "id": "Scope", 1252 "type": "object", 1253 "properties": { 1254 "type": { "type": "string", "enum": ["global", "local", "with", "closure", "catch"], "description": "Scope type." }, 1255 "object": { "$ref": "RemoteObject", "description": "Object representing the scope." }, 1256 "this": { "$ref": "RemoteObject", "optional": true, "description": "<code>this</code> object for local scope." }, 1247 1257 }, 1248 1258 "description": "Debugger call frame. Array of call frames form call stack." -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
r83290 r83434 315 315 void InspectorDebuggerAgent::resume(ErrorString*) 316 316 { 317 m_injectedScriptManager->releaseObjectGroup("backtrace"); 317 318 scriptDebugServer().continueProgram(); 318 319 } -
trunk/Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js
r76795 r83434 60 60 var scopeChain = callFrame.scopeChain; 61 61 for (var i = 0; i < scopeChain.length; ++i) { 62 var scope ObjectProxy= scopeChain[i];62 var scope = scopeChain[i]; 63 63 var title = null; 64 var subtitle = scope ObjectProxy.description;64 var subtitle = scope.object.description; 65 65 var emptyPlaceholder = null; 66 66 var extraProperties = null; 67 67 68 if (scopeObjectProxy.isLocal) { 69 foundLocalScope = true; 70 title = WebInspector.UIString("Local"); 71 emptyPlaceholder = WebInspector.UIString("No Variables"); 72 subtitle = null; 73 if (scopeObjectProxy.thisObject) 74 extraProperties = [ new WebInspector.RemoteObjectProperty("this", WebInspector.RemoteObject.fromPayload(scopeObjectProxy.thisObject)) ]; 75 } else if (scopeObjectProxy.isClosure) { 76 title = WebInspector.UIString("Closure"); 77 emptyPlaceholder = WebInspector.UIString("No Variables"); 78 subtitle = null; 79 } else if (i === (scopeChain.length - 1)) 80 title = WebInspector.UIString("Global"); 81 else if (scopeObjectProxy.isElement) 82 title = WebInspector.UIString("Event Target"); 83 else if (scopeObjectProxy.isDocument) 84 title = WebInspector.UIString("Event Document"); 85 else if (scopeObjectProxy.isWithBlock) 86 title = WebInspector.UIString("With Block"); 68 switch (scope.type) { 69 case "local": 70 foundLocalScope = true; 71 title = WebInspector.UIString("Local"); 72 emptyPlaceholder = WebInspector.UIString("No Variables"); 73 subtitle = null; 74 if (scope.this) 75 extraProperties = [ new WebInspector.RemoteObjectProperty("this", WebInspector.RemoteObject.fromPayload(scope.this)) ]; 76 break; 77 case "closure": 78 title = WebInspector.UIString("Closure"); 79 emptyPlaceholder = WebInspector.UIString("No Variables"); 80 subtitle = null; 81 break; 82 case "catch": 83 title = WebInspector.UIString("Catch"); 84 break; 85 case "with": 86 title = WebInspector.UIString("With Block"); 87 break; 88 case "global": 89 title = WebInspector.UIString("Global"); 90 break; 91 } 87 92 88 93 if (!title || title === subtitle) 89 94 subtitle = null; 90 95 91 var section = new WebInspector.ObjectPropertiesSection(WebInspector.RemoteObject.fromPayload(scope ObjectProxy), title, subtitle, emptyPlaceholder, true, extraProperties, WebInspector.ScopeVariableTreeElement);96 var section = new WebInspector.ObjectPropertiesSection(WebInspector.RemoteObject.fromPayload(scope.object), title, subtitle, emptyPlaceholder, true, extraProperties, WebInspector.ScopeVariableTreeElement); 92 97 section.editInSelectedCallFrameWhenPaused = true; 93 98 section.pane = this; 94 99 95 if (!foundLocalScope || scope ObjectProxy.isLocal|| title in this._expandedSections)100 if (!foundLocalScope || scope.type === "local" || title in this._expandedSections) 96 101 section.expanded = true; 97 102
Note: See TracChangeset
for help on using the changeset viewer.