| Index: Source/devtools/front_end/sources/ScriptFormatter.js
|
| diff --git a/Source/devtools/front_end/sources/ScriptFormatter.js b/Source/devtools/front_end/sources/ScriptFormatter.js
|
| index 13b0814a2c947a0ee229d27a3830737f25e1390f..f26a14035659bac90e4c091afdfa4552a35fcebd 100644
|
| --- a/Source/devtools/front_end/sources/ScriptFormatter.js
|
| +++ b/Source/devtools/front_end/sources/ScriptFormatter.js
|
| @@ -105,7 +105,7 @@ WebInspector.ScriptFormatter.prototype = {
|
| const method = "format";
|
| var parameters = { mimeType: mimeType, content: content, indentString: WebInspector.settings.textEditorIndent.get() };
|
| this._tasks.push({ data: parameters, callback: callback });
|
| - this._worker.postMessage({ method: method, params: parameters });
|
| + this._worker().postMessage({ method: method, params: parameters });
|
| },
|
|
|
| _didFormatContent: function(event)
|
| @@ -119,12 +119,12 @@ WebInspector.ScriptFormatter.prototype = {
|
| },
|
|
|
| /**
|
| - * @return {!Worker}
|
| + * @return {!WorkerRuntime.Worker}
|
| */
|
| - get _worker()
|
| + _worker: function()
|
| {
|
| if (!this._cachedWorker) {
|
| - this._cachedWorker = Runtime.startWorker("script_formatter_worker");
|
| + this._cachedWorker = new WorkerRuntime.Worker("script_formatter_worker");
|
| this._cachedWorker.onmessage = /** @type {function(this:Worker)} */ (this._didFormatContent.bind(this));
|
| }
|
| return this._cachedWorker;
|
|
|