| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 /** | 27 /** |
| 28 * @constructor | 28 * @constructor |
| 29 * @extends {WebInspector.SidebarPane} | 29 * @extends {WebInspector.SidebarPane} |
| 30 */ | 30 */ |
| 31 WebInspector.ScopeChainSidebarPane = function() | 31 WebInspector.ScopeChainSidebarPane = function() |
| 32 { | 32 { |
| 33 WebInspector.SidebarPane.call(this, WebInspector.UIString("Scope")); | 33 WebInspector.SidebarPane.call(this, WebInspector.UIString("Scope")); |
| 34 this._expandController = new WebInspector.ObjectPropertiesSectionExpandContr
oller(); | 34 this._expandController = new WebInspector.ObjectPropertiesSectionExpandContr
oller(); |
| 35 this._linkifier = new WebInspector.Linkifier(); |
| 35 } | 36 } |
| 36 | 37 |
| 37 WebInspector.ScopeChainSidebarPane._pathSymbol = Symbol("path"); | 38 WebInspector.ScopeChainSidebarPane._pathSymbol = Symbol("path"); |
| 38 | 39 |
| 39 WebInspector.ScopeChainSidebarPane.prototype = { | 40 WebInspector.ScopeChainSidebarPane.prototype = { |
| 40 /** | 41 /** |
| 41 * @param {?WebInspector.DebuggerModel.CallFrame} callFrame | 42 * @param {?WebInspector.DebuggerModel.CallFrame} callFrame |
| 42 */ | 43 */ |
| 43 update: function(callFrame) | 44 update: function(callFrame) |
| 44 { | 45 { |
| 46 this._linkifier.reset(); |
| 45 WebInspector.SourceMapNamesResolver.resolveThisObject(callFrame) | 47 WebInspector.SourceMapNamesResolver.resolveThisObject(callFrame) |
| 46 .then(this._innerUpdate.bind(this, callFrame)); | 48 .then(this._innerUpdate.bind(this, callFrame)); |
| 47 }, | 49 }, |
| 48 | 50 |
| 49 /** | 51 /** |
| 50 * @param {?WebInspector.DebuggerModel.CallFrame} callFrame | 52 * @param {?WebInspector.DebuggerModel.CallFrame} callFrame |
| 51 * @param {?WebInspector.RemoteObject} thisObject | 53 * @param {?WebInspector.RemoteObject} thisObject |
| 52 */ | 54 */ |
| 53 _innerUpdate: function(callFrame, thisObject) | 55 _innerUpdate: function(callFrame, thisObject) |
| 54 { | 56 { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 115 } |
| 114 | 116 |
| 115 var subtitle = scope.description(); | 117 var subtitle = scope.description(); |
| 116 if (!title || title === subtitle) | 118 if (!title || title === subtitle) |
| 117 subtitle = undefined; | 119 subtitle = undefined; |
| 118 | 120 |
| 119 var titleElement = createElementWithClass("div", "scope-chain-sideba
r-pane-section-header"); | 121 var titleElement = createElementWithClass("div", "scope-chain-sideba
r-pane-section-header"); |
| 120 titleElement.createChild("div", "scope-chain-sidebar-pane-section-su
btitle").textContent = subtitle; | 122 titleElement.createChild("div", "scope-chain-sidebar-pane-section-su
btitle").textContent = subtitle; |
| 121 titleElement.createChild("div", "scope-chain-sidebar-pane-section-ti
tle").textContent = title; | 123 titleElement.createChild("div", "scope-chain-sidebar-pane-section-ti
tle").textContent = title; |
| 122 | 124 |
| 123 var section = new WebInspector.ObjectPropertiesSection(WebInspector.
SourceMapNamesResolver.resolveScopeInObject(scope), titleElement, emptyPlacehold
er, true, extraProperties); | 125 var section = new WebInspector.ObjectPropertiesSection(WebInspector.
SourceMapNamesResolver.resolveScopeInObject(scope), titleElement, this._linkifie
r, emptyPlaceholder, true, extraProperties); |
| 124 this._expandController.watchSection(title + (subtitle ? ":" + subtit
le : ""), section); | 126 this._expandController.watchSection(title + (subtitle ? ":" + subtit
le : ""), section); |
| 125 | 127 |
| 126 if (scope.type() === DebuggerAgent.ScopeType.Global) | 128 if (scope.type() === DebuggerAgent.ScopeType.Global) |
| 127 section.objectTreeElement().collapse(); | 129 section.objectTreeElement().collapse(); |
| 128 else if (!foundLocalScope || scope.type() === DebuggerAgent.ScopeTyp
e.Local) | 130 else if (!foundLocalScope || scope.type() === DebuggerAgent.ScopeTyp
e.Local) |
| 129 section.objectTreeElement().expand(); | 131 section.objectTreeElement().expand(); |
| 130 | 132 |
| 131 section.element.classList.add("scope-chain-sidebar-pane-section"); | 133 section.element.classList.add("scope-chain-sidebar-pane-section"); |
| 132 this.element.appendChild(section.element); | 134 this.element.appendChild(section.element); |
| 133 } | 135 } |
| 134 this._sidebarPaneUpdatedForTest(); | 136 this._sidebarPaneUpdatedForTest(); |
| 135 }, | 137 }, |
| 136 | 138 |
| 137 _sidebarPaneUpdatedForTest: function() { }, | 139 _sidebarPaneUpdatedForTest: function() { }, |
| 138 | 140 |
| 139 __proto__: WebInspector.SidebarPane.prototype | 141 __proto__: WebInspector.SidebarPane.prototype |
| 140 } | 142 } |
| OLD | NEW |