mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 02:02:35 -05:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -6,15 +6,6 @@
|
||||
import { transformErrorForSerialization } from 'vs/base/common/errors';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { isWeb } from 'vs/base/common/platform';
|
||||
import { PolyfillPromise } from 'vs/base/common/winjs.polyfill.promise';
|
||||
|
||||
var global: any = self;
|
||||
|
||||
// When missing, polyfill the native promise
|
||||
// with our winjs-based polyfill
|
||||
if (typeof global.Promise === 'undefined') {
|
||||
global.Promise = PolyfillPromise;
|
||||
}
|
||||
|
||||
const INITIALIZE = '$initialize';
|
||||
|
||||
@@ -243,8 +234,8 @@ export class SimpleWorkerClient<T> extends Disposable {
|
||||
lazyProxyReject = reject;
|
||||
this._onModuleLoaded.then((availableMethods: string[]) => {
|
||||
let proxy = <T>{};
|
||||
for (let i = 0; i < availableMethods.length; i++) {
|
||||
(proxy as any)[availableMethods[i]] = createProxyMethod(availableMethods[i], proxyMethodRequest);
|
||||
for (const methodName of availableMethods) {
|
||||
(proxy as any)[methodName] = createProxyMethod(methodName, proxyMethodRequest);
|
||||
}
|
||||
resolve(proxy);
|
||||
}, (e) => {
|
||||
@@ -254,11 +245,11 @@ export class SimpleWorkerClient<T> extends Disposable {
|
||||
});
|
||||
|
||||
// Create proxy to loaded code
|
||||
let proxyMethodRequest = (method: string, args: any[]): Promise<any> => {
|
||||
const proxyMethodRequest = (method: string, args: any[]): Promise<any> => {
|
||||
return this._request(method, args);
|
||||
};
|
||||
|
||||
let createProxyMethod = (method: string, proxyMethodRequest: (method: string, args: any[]) => Promise<any>): Function => {
|
||||
const createProxyMethod = (method: string, proxyMethodRequest: (method: string, args: any[]) => Promise<any>): () => Promise<any> => {
|
||||
return function () {
|
||||
let args = Array.prototype.slice.call(arguments, 0);
|
||||
return proxyMethodRequest(method, args);
|
||||
|
||||
Reference in New Issue
Block a user