Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)

* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998

* fix pipelines

* fix strict-null-checks

* add missing files
This commit is contained in:
Anthony Dresser
2019-10-21 22:12:22 -07:00
committed by GitHub
parent 7c9be74970
commit 1e22f47304
913 changed files with 18898 additions and 16536 deletions

View File

@@ -219,13 +219,23 @@ export class InstantiationService implements IInstantiationService {
// Return a proxy object that's backed by an idle value. That
// strategy is to instantiate services in our idle time or when actually
// needed but not when injected into a consumer
const idle = new IdleValue(() => this._createInstance<T>(ctor, args, _trace));
const idle = new IdleValue<any>(() => this._createInstance<T>(ctor, args, _trace));
return <T>new Proxy(Object.create(null), {
get(_target: T, prop: PropertyKey): any {
return (idle.getValue() as any)[prop];
get(target: any, key: PropertyKey): any {
if (key in target) {
return target[key];
}
let obj = idle.getValue();
let prop = obj[key];
if (typeof prop !== 'function') {
return prop;
}
prop = prop.bind(obj);
target[key] = prop;
return prop;
},
set(_target: T, p: PropertyKey, value: any): boolean {
(idle.getValue() as any)[p] = value;
idle.getValue()[p] = value;
return true;
}
});
@@ -242,7 +252,7 @@ const enum TraceType {
// {{SQL CARBON EDIT}} - Export trace
export class Trace {
private static _None = new class extends Trace {
private static readonly _None = new class extends Trace {
constructor() { super(-1, null); }
stop() { }
branch() { return this; }