Reviewers: lushnikov
CL:
https://codereview.chromium.org/2384953002/Message:
Andrey, please take a look! If it is fine, I'll add a test on Monday.
Description:
[DevTools] Fixed breakpoints in hotreloaded scripts
We need to use last arrived script for ResourceScriptFile.
Otherwise _isDiverged check will always return true in case of:
eval("source1 //# sourceURL=foo.js")
eval("source2 //# sourceURL=foo.js")
BUG=617450,623150
R=lush...@chromium.orgAffected files (+2, -2 lines):
M third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
Index: third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
index 04f8b130c49ce00587b952663f6ee129858e562a..a8caac26e89246b4dd31f7e2bf8dd479195003b1 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
@@ -91,7 +91,7 @@ WebInspector.ResourceScriptMapping.prototype = {
{
var scripts = this._scriptsForUISourceCode(uiSourceCode);
console.assert(scripts.length);
- var script = scripts[0];
+ var script = scripts[scripts.length - 1];
if (script.isInlineScriptWithSourceURL())
return this._debuggerModel.createRawLocation(script, lineNumber + script.lineOffset, lineNumber ? columnNumber : columnNumber + script.columnOffset);
return this._debuggerModel.createRawLocation(script, lineNumber, columnNumber);
@@ -281,7 +281,7 @@ WebInspector.ResourceScriptFile = function(resourceScriptMapping, uiSourceCode,
this._uiSourceCode = uiSourceCode;
if (this._uiSourceCode.contentType().isScript())
- this._script = scripts[0];
+ this._script = scripts[scripts.length - 1];
this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this);
this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this);