Index: Source/devtools/front_end/ScriptFormatterEditorAction.js |
diff --git a/Source/devtools/front_end/ScriptFormatterEditorAction.js b/Source/devtools/front_end/ScriptFormatterEditorAction.js |
index 3dd22eab61ef2bf3cb139a107c282bd4871f212c..2c58bc6f2cb94f1fba3d8c1cf561bf32a1758314 100644 |
--- a/Source/devtools/front_end/ScriptFormatterEditorAction.js |
+++ b/Source/devtools/front_end/ScriptFormatterEditorAction.js |
@@ -73,25 +73,13 @@ WebInspector.FormatterScriptMapping.prototype = { |
*/ |
_scriptsForUISourceCode: function(uiSourceCode) |
{ |
- var isInlineScript; |
- switch (uiSourceCode.contentType()) { |
- case WebInspector.resourceTypes.Document: |
- isInlineScript = true; |
- break; |
- case WebInspector.resourceTypes.Script: |
- isInlineScript = false; |
- break; |
- default: |
- return []; |
+ if (uiSourceCode.contentType() === WebInspector.resourceTypes.Document) |
+ return this._debuggerModel.scriptsForSourceURL(uiSourceCode.url); |
vsevik
2014/03/26 09:02:34
Please keep the inline filter.
pfeldman
2014/03/26 09:24:37
But this does not add any value. Why would we?
|
+ if (uiSourceCode.contentType() === WebInspector.resourceTypes.Script) { |
+ var rawLocation = uiSourceCode.uiLocationToRawLocation(0, 0); |
+ return rawLocation ? [this._debuggerModel.scriptForId(rawLocation.scriptId)] : []; |
aandrey
2014/03/25 19:33:54
can return [undefined]
pfeldman
2014/03/25 20:01:40
I don't think so - uiSourceCode here is using defa
|
} |
- var scripts = this._debuggerModel.scriptsForSourceURL(uiSourceCode.url); |
- |
- function filterOutIncorrectInlineType(script) |
- { |
- return script.isInlineScript() === isInlineScript; |
- } |
- |
- return scripts.filter(filterOutIncorrectInlineType); |
+ return []; |
}, |
_init: function() |