mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-19 19:41:37 -04:00
Merge from master
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
let MonacoEnvironment = (<any>self).MonacoEnvironment;
|
||||
let monacoBaseUrl = MonacoEnvironment && MonacoEnvironment.baseUrl ? MonacoEnvironment.baseUrl : '../../../';
|
||||
@@ -27,7 +26,7 @@
|
||||
|
||||
self.onmessage = (e) => messageHandler.onmessage(e.data);
|
||||
while (beforeReadyMessages.length > 0) {
|
||||
self.onmessage(beforeReadyMessages.shift());
|
||||
self.onmessage(beforeReadyMessages.shift()!);
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user