| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 { | 68 { |
| 69 if (internalProperties) { | 69 if (internalProperties) { |
| 70 for (var i = 0; i < internalProperties.length; i++) { | 70 for (var i = 0; i < internalProperties.length; i++) { |
| 71 if (internalProperties[i].name === "[[TargetFunction]]") { | 71 if (internalProperties[i].name === "[[TargetFunction]]") { |
| 72 funcObject = internalProperties[i].value; | 72 funcObject = internalProperties[i].value; |
| 73 break; | 73 break; |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 WebInspector.ObjectPropertiesSection.formatObjectAsFunction(funcObje
ct, popoverValueElement, true); | 77 WebInspector.ObjectPropertiesSection.formatObjectAsFunction(funcObje
ct, popoverValueElement, true); |
| 78 funcObject.functionDetails(didGetFunctionDetails.bind(this, popoverC
ontentElement, anchorElement)); | 78 funcObject.debuggerModel().functionDetailsPromise(funcObject).then(d
idGetFunctionDetails.bind(this, popoverContentElement, anchorElement)); |
| 79 } | 79 } |
| 80 | 80 |
| 81 /** | 81 /** |
| 82 * @param {!Element} popoverContentElement | 82 * @param {!Element} popoverContentElement |
| 83 * @param {!Element} anchorElement | 83 * @param {!Element} anchorElement |
| 84 * @param {?WebInspector.DebuggerModel.FunctionDetails} response | 84 * @param {?WebInspector.DebuggerModel.FunctionDetails} response |
| 85 * @this {WebInspector.ObjectPopoverHelper} | 85 * @this {WebInspector.ObjectPopoverHelper} |
| 86 */ | 86 */ |
| 87 function didGetFunctionDetails(popoverContentElement, anchorElement, res
ponse) | 87 function didGetFunctionDetails(popoverContentElement, anchorElement, res
ponse) |
| 88 { | 88 { |
| 89 if (!response || popover.disposed) | 89 if (!response || popover.disposed) |
| 90 return; | 90 return; |
| 91 | 91 |
| 92 var container = createElementWithClass("div", "object-popover-contai
ner"); | 92 var container = createElementWithClass("div", "object-popover-contai
ner"); |
| 93 var title = container.createChild("div", "function-popover-title sou
rce-code"); | 93 var title = container.createChild("div", "function-popover-title sou
rce-code"); |
| 94 var functionName = title.createChild("span", "function-name"); | 94 var functionName = title.createChild("span", "function-name"); |
| 95 functionName.textContent = WebInspector.beautifyFunctionName(respons
e.functionName); | 95 functionName.textContent = WebInspector.beautifyFunctionName(respons
e.functionName); |
| 96 | 96 |
| 97 var rawLocation = response.location; | 97 var rawLocation = response.location; |
| 98 var sourceURL = response.sourceURL; | |
| 99 var linkContainer = title.createChild("div", "function-title-link-co
ntainer"); | 98 var linkContainer = title.createChild("div", "function-title-link-co
ntainer"); |
| 100 if (rawLocation && Runtime.experiments.isEnabled("continueToFirstInv
ocation")) { | 99 if (rawLocation && Runtime.experiments.isEnabled("continueToFirstInv
ocation")) { |
| 101 var sectionToolbar = new WebInspector.Toolbar("function-location
-step-into", linkContainer); | 100 var sectionToolbar = new WebInspector.Toolbar("function-location
-step-into", linkContainer); |
| 102 var stepInto = new WebInspector.ToolbarButton(WebInspector.UIStr
ing("Continue to first invocation"), "step-in-toolbar-item"); | 101 var stepInto = new WebInspector.ToolbarButton(WebInspector.UIStr
ing("Continue to first invocation"), "step-in-toolbar-item"); |
| 103 stepInto.addEventListener("click", () => rawLocation.continueToL
ocation()); | 102 stepInto.addEventListener("click", () => rawLocation.continueToL
ocation()); |
| 104 sectionToolbar.appendToolbarItem(stepInto); | 103 sectionToolbar.appendToolbarItem(stepInto); |
| 105 } | 104 } |
| 105 var sourceURL = rawLocation.script() ? rawLocation.script().sourceUR
L : null; |
| 106 if (rawLocation && sourceURL) { | 106 if (rawLocation && sourceURL) { |
| 107 var link = this._lazyLinkifier().linkifyRawLocation(rawLocation,
sourceURL); | 107 var link = this._lazyLinkifier().linkifyRawLocation(rawLocation,
sourceURL); |
| 108 linkContainer.appendChild(link); | 108 linkContainer.appendChild(link); |
| 109 } | 109 } |
| 110 container.appendChild(popoverContentElement); | 110 container.appendChild(popoverContentElement); |
| 111 popover.showForAnchor(container, anchorElement); | 111 popover.showForAnchor(container, anchorElement); |
| 112 } | 112 } |
| 113 | 113 |
| 114 /** | 114 /** |
| 115 * @param {!WebInspector.RemoteObject} result | 115 * @param {!WebInspector.RemoteObject} result |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 */ | 195 */ |
| 196 _lazyLinkifier: function() | 196 _lazyLinkifier: function() |
| 197 { | 197 { |
| 198 if (!this._linkifier) | 198 if (!this._linkifier) |
| 199 this._linkifier = new WebInspector.Linkifier(); | 199 this._linkifier = new WebInspector.Linkifier(); |
| 200 return this._linkifier; | 200 return this._linkifier; |
| 201 }, | 201 }, |
| 202 | 202 |
| 203 __proto__: WebInspector.PopoverHelper.prototype | 203 __proto__: WebInspector.PopoverHelper.prototype |
| 204 } | 204 } |
| OLD | NEW |