Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(610)

Unified Diff: third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js

Issue 2173233002: [DevTools] Better locations for snippets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added a test Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
index b771ffd8ecd29ffe6ed3ba1f52adad1a427697f1..60dfa589a237a866479cde0edc4c8957d82379e0 100644
--- a/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
@@ -240,12 +240,12 @@ WebInspector.ScriptSnippetModel.prototype = {
if (mapping.evaluationIndex(uiSourceCode) !== evaluationIndex)
return;
+ mapping._addScript(executionContext.debuggerModel.scriptForId(scriptId || exceptionDetails.scriptId), uiSourceCode);
if (!scriptId) {
this._printRunOrCompileScriptResultFailure(target, exceptionDetails, evaluationUrl);
return;
}
- mapping._addScript(executionContext.debuggerModel.scriptForId(scriptId), uiSourceCode);
var breakpointLocations = this._removeBreakpoints(uiSourceCode);
this._restoreBreakpoints(uiSourceCode, breakpointLocations);
@@ -272,7 +272,7 @@ WebInspector.ScriptSnippetModel.prototype = {
function runCallback(target, result, exceptionDetails)
{
if (!exceptionDetails)
- this._printRunScriptResult(target, result, sourceURL);
+ this._printRunScriptResult(target, result, scriptId, sourceURL);
else
this._printRunOrCompileScriptResultFailure(target, exceptionDetails, sourceURL);
}
@@ -281,9 +281,10 @@ WebInspector.ScriptSnippetModel.prototype = {
/**
* @param {!WebInspector.Target} target
* @param {?RuntimeAgent.RemoteObject} result
+ * @param {!RuntimeAgent.ScriptId} scriptId
* @param {?string=} sourceURL
*/
- _printRunScriptResult: function(target, result, sourceURL)
+ _printRunScriptResult: function(target, result, scriptId, sourceURL)
{
var consoleMessage = new WebInspector.ConsoleMessage(
target,
@@ -296,7 +297,10 @@ WebInspector.ScriptSnippetModel.prototype = {
undefined,
undefined,
[result],
- undefined);
+ undefined,
+ undefined,
+ undefined,
+ scriptId);
target.consoleModel.addMessage(consoleMessage);
},
@@ -318,7 +322,10 @@ WebInspector.ScriptSnippetModel.prototype = {
exceptionDetails.columnNumber,
undefined,
undefined,
- exceptionDetails.stackTrace);
+ exceptionDetails.stackTrace,
+ undefined,
+ undefined,
+ exceptionDetails.stackTrace ? undefined : exceptionDetails.scriptId);
target.consoleModel.addMessage(consoleMessage);
},

Powered by Google App Engine
This is Rietveld 408576698