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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 /** | 58 /** |
59 * @param {!Element} element | 59 * @param {!Element} element |
60 * @param {!WebInspector.Popover} popover | 60 * @param {!WebInspector.Popover} popover |
61 */ | 61 */ |
62 _showObjectPopover: function(element, popover) | 62 _showObjectPopover: function(element, popover) |
63 { | 63 { |
64 /** | 64 /** |
65 * @param {!WebInspector.Target} target | 65 * @param {!WebInspector.Target} target |
66 * @param {!Element} anchorElement | 66 * @param {!Element} anchorElement |
67 * @param {!Element} popoverContentElement | 67 * @param {!Element} popoverContentElement |
68 * @param {?DebuggerAgent.FunctionDetails} response | 68 * @param {?WebInspector.DebuggerModel.FunctionDetails} response |
69 * @this {WebInspector.ObjectPopoverHelper} | 69 * @this {WebInspector.ObjectPopoverHelper} |
70 */ | 70 */ |
71 function didGetDetails(target, anchorElement, popoverContentElement, res
ponse) | 71 function didGetDetails(target, anchorElement, popoverContentElement, res
ponse) |
72 { | 72 { |
73 if (!response) | 73 if (!response) |
74 return; | 74 return; |
75 | 75 |
76 var container = document.createElement("div"); | 76 var container = document.createElement("div"); |
77 container.className = "inline-block"; | 77 container.className = "inline-block"; |
78 | 78 |
79 var title = container.createChild("div", "function-popover-title sou
rce-code"); | 79 var title = container.createChild("div", "function-popover-title sou
rce-code"); |
80 var functionName = title.createChild("span", "function-name"); | 80 var functionName = title.createChild("span", "function-name"); |
81 functionName.textContent = response.functionName || WebInspector.UIS
tring("(anonymous function)"); | 81 functionName.textContent = response.functionName || WebInspector.UIS
tring("(anonymous function)"); |
82 | 82 |
83 this._linkifier = new WebInspector.Linkifier(); | 83 var rawLocation = response.location; |
84 var rawLocation = WebInspector.DebuggerModel.Location.fromPayload(ta
rget, response.location); | 84 var link; |
85 var link = this._linkifier.linkifyRawLocation(rawLocation, "function
-location-link"); | 85 if (rawLocation) { |
| 86 this._linkifier = new WebInspector.Linkifier(); |
| 87 link = this._linkifier.linkifyRawLocation(rawLocation, "function
-location-link"); |
| 88 } |
86 if (link) | 89 if (link) |
87 title.appendChild(link); | 90 title.appendChild(link); |
88 | 91 |
89 container.appendChild(popoverContentElement); | 92 container.appendChild(popoverContentElement); |
90 | 93 |
91 popover.show(container, anchorElement); | 94 popover.show(container, anchorElement); |
92 } | 95 } |
93 | 96 |
94 /** | 97 /** |
95 * @param {!WebInspector.RemoteObject} result | 98 * @param {!WebInspector.RemoteObject} result |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 if (properties[i].value.description) | 181 if (properties[i].value.description) |
179 this._titleElement.textContent += "#" + properties[i].value.
description; | 182 this._titleElement.textContent += "#" + properties[i].value.
description; |
180 break; | 183 break; |
181 } | 184 } |
182 } | 185 } |
183 this._sectionUpdateProperties(properties, rootTreeElementConstructor, ro
otPropertyComparer); | 186 this._sectionUpdateProperties(properties, rootTreeElementConstructor, ro
otPropertyComparer); |
184 }, | 187 }, |
185 | 188 |
186 __proto__: WebInspector.PopoverHelper.prototype | 189 __proto__: WebInspector.PopoverHelper.prototype |
187 } | 190 } |
OLD | NEW |