Index: third_party/WebKit/Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js b/third_party/WebKit/Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js |
index df531442b22679bf6917ae6721001356beb29bff..eeb464974778dd434c229866824e175c5c54ddb3 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js |
+++ b/third_party/WebKit/Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js |
@@ -99,8 +99,8 @@ FormatterWorker.javaScriptOutline = function(params) |
var isReadingArguments = false; |
var argumentsText = ""; |
var currentFunction = null; |
- var tokenizer = new FormatterWorker.AcornTokenizer(params.content); |
- var AT = FormatterWorker.AcornTokenizer; |
+ var tokenizer = new WebInspector.AcornTokenizer(params.content); |
+ var AT = WebInspector.AcornTokenizer; |
while (tokenizer.peekToken()) { |
var token = /** @type {!Acorn.TokenOrComment} */(tokenizer.nextToken()); |
@@ -522,3 +522,14 @@ FormatterWorker.HTMLFormatter.prototype = { |
this._position = cursor; |
} |
} |
+ |
+// A dummy javascript mode which is used only by htmlmixed mode to advance |
+// stream until a </script> is found. |
+CodeMirror.defineMode("javascript", function(config, parserConfig) { |
+ return { |
+ token: function(stream, state) |
+ { |
+ return stream.next(); |
+ } |
+ } |
+}); |