Chromium Code Reviews| Index: Source/devtools/front_end/bindings/ResourceScriptMapping.js |
| diff --git a/Source/devtools/front_end/bindings/ResourceScriptMapping.js b/Source/devtools/front_end/bindings/ResourceScriptMapping.js |
| index 88336246748f143c81202cc3158147d444897116..5aab2798b7dab9aaa180b40eafcdc227fede71cc 100644 |
| --- a/Source/devtools/front_end/bindings/ResourceScriptMapping.js |
| +++ b/Source/devtools/front_end/bindings/ResourceScriptMapping.js |
| @@ -239,6 +239,10 @@ WebInspector.ResourceScriptMapping.prototype = { |
| _bindUISourceCodeToScripts: function(uiSourceCode, scripts) |
| { |
| console.assert(scripts.length); |
| + var boundScriptFile = this.scriptFile(uiSourceCode); |
| + if (boundScriptFile && boundScriptFile.hasScripts(scripts)) |
|
yurys
2015/07/16 16:30:35
Was it a bug or what? If so it may make sense to e
dgozman
2015/07/17 14:39:16
This is a race, but it always happened in one orde
|
| + return; |
| + |
| var scriptFile = new WebInspector.ResourceScriptFile(this, uiSourceCode, scripts); |
| this._setScriptFile(uiSourceCode, scriptFile); |
| for (var i = 0; i < scripts.length; ++i) |
| @@ -310,6 +314,18 @@ WebInspector.ResourceScriptFile.Events = { |
| WebInspector.ResourceScriptFile.prototype = { |
| /** |
| + * @param {!Array.<!WebInspector.Script>} scripts |
| + * @return {boolean} |
| + */ |
| + hasScripts: function(scripts) |
| + { |
| + var script; |
| + if (this._uiSourceCode.contentType() === WebInspector.resourceTypes.Script) |
| + script = scripts[0]; |
| + return this._script === script; |
| + }, |
| + |
| + /** |
| * @param {function(?string,!DebuggerAgent.SetScriptSourceError=,!WebInspector.Script=)=} callback |
| */ |
| commitLiveEdit: function(callback) |