Chromium Code Reviews| Index: Source/devtools/front_end/sources/JavaScriptSourceFrame.js |
| diff --git a/Source/devtools/front_end/sources/JavaScriptSourceFrame.js b/Source/devtools/front_end/sources/JavaScriptSourceFrame.js |
| index f2331b8913c89994b9ae2f855f63f3babf659da0..70058d15984721181b70d9f8c582d62033e2f4f0 100644 |
| --- a/Source/devtools/front_end/sources/JavaScriptSourceFrame.js |
| +++ b/Source/devtools/front_end/sources/JavaScriptSourceFrame.js |
| @@ -422,7 +422,8 @@ WebInspector.JavaScriptSourceFrame.prototype = { |
| _getPopoverAnchor: function(element, event) |
| { |
| - if (!WebInspector.debuggerModel.isPaused()) |
| + var target = WebInspector.context.flavor(WebInspector.Target); |
| + if (!target || !target.debuggerModel.isPaused()) |
| return null; |
| var textPosition = this.textEditor.coordinatesToCursorPosition(event.x, event.y); |
| @@ -473,7 +474,8 @@ WebInspector.JavaScriptSourceFrame.prototype = { |
| _resolveObjectForPopover: function(anchorBox, showCallback, objectGroupName) |
| { |
| - if (!WebInspector.debuggerModel.isPaused()) { |
| + var target = WebInspector.context.flavor(WebInspector.Target); |
| + if (!target || !target.debuggerModel.isPaused()) { |
| this._popoverHelper.hidePopover(); |
| return; |
| } |
| @@ -492,7 +494,7 @@ WebInspector.JavaScriptSourceFrame.prototype = { |
| } |
| } |
| var evaluationText = line.substring(startHighlight, endHighlight + 1); |
| - var selectedCallFrame = WebInspector.debuggerModel.selectedCallFrame(); |
| + var selectedCallFrame = target.debuggerModel.selectedCallFrame(); |
| selectedCallFrame.evaluate(evaluationText, objectGroupName, false, true, false, false, showObjectPopover.bind(this)); |
| /** |
| @@ -502,12 +504,13 @@ WebInspector.JavaScriptSourceFrame.prototype = { |
| */ |
| function showObjectPopover(result, wasThrown) |
| { |
| - if (!WebInspector.debuggerModel.isPaused() || !result) { |
| + var target = selectedCallFrame.target(); |
|
vsevik
2014/06/26 07:50:32
The target might have changed, so I suggest doing
sergeyv
2014/06/26 09:21:09
Done.
But I check that target hasn't changed since
|
| + if (!target.debuggerModel.isPaused() || !result) { |
| this._popoverHelper.hidePopover(); |
| return; |
| } |
| this._popoverAnchorBox = anchorBox; |
| - showCallback(selectedCallFrame.target().runtimeModel.createRemoteObject(result), wasThrown, this._popoverAnchorBox); |
| + showCallback(target.runtimeModel.createRemoteObject(result), wasThrown, this._popoverAnchorBox); |
| // Popover may have been removed by showCallback(). |
| if (this._popoverAnchorBox) { |
| var highlightRange = new WebInspector.TextRange(lineNumber, startHighlight, lineNumber, endHighlight); |