Merge VS Code 1.31.1 (#4283)

This commit is contained in:
Matt Irvine
2019-03-15 13:09:45 -07:00
committed by GitHub
parent 7d31575149
commit 86bac90001
1716 changed files with 53308 additions and 48375 deletions

View File

@@ -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);