Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

View File

@@ -2,10 +2,9 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { globals } from 'vs/base/common/platform';
import { logOnceWebWorkerWarning, IWorker, IWorkerCallback, IWorkerFactory } from 'vs/base/common/worker/simpleWorker';
import { IWorker, IWorkerCallback, IWorkerFactory, logOnceWebWorkerWarning } from 'vs/base/common/worker/simpleWorker';
function getWorker(workerId: string, label: string): Worker {
// Option for hosts to overwrite the worker script (used in the standalone editor)
@@ -32,7 +31,7 @@ function getWorker(workerId: string, label: string): Worker {
class WebWorker implements IWorker {
private id: number;
private worker: Worker;
private worker: Worker | null;
constructor(moduleId: string, id: number, label: string, onMessageCallback: IWorkerCallback, onErrorCallback: (err: any) => void) {
this.id = id;
@@ -57,7 +56,9 @@ class WebWorker implements IWorker {
}
public dispose(): void {
this.worker.terminate();
if (this.worker) {
this.worker.terminate();
}
this.worker = null;
}
}
@@ -66,10 +67,10 @@ export class DefaultWorkerFactory implements IWorkerFactory {
private static LAST_WORKER_ID = 0;
private _label: string;
private _label: string | undefined;
private _webWorkerFailedBeforeError: any;
constructor(label: string) {
constructor(label: string | undefined) {
this._label = label;
this._webWorkerFailedBeforeError = false;
}