Reenable strict null checks (#6716)

* add some patches for strict null

* renable strict null checks
This commit is contained in:
Anthony Dresser
2019-08-13 14:33:08 -07:00
committed by GitHub
parent 60bf331f19
commit 7008e88678
9 changed files with 35 additions and 24 deletions

View File

@@ -297,7 +297,7 @@ function topStep<T>(array: ReadonlyArray<T>, compare: (a: T, b: T) => number, re
*/
export function coalesce<T>(array: ReadonlyArray<T | undefined | null>): T[] {
if (!array) {
return undefined; // {{SQL CARBON EDIT}} @anthonydresser strict-null-checks
return array as T[]; // {{SQL CARBON EDIT}} @anthonydresser strict-null-checks
}
return <T[]>array.filter(e => !!e);
}

View File

@@ -21,7 +21,7 @@ export class ProductService implements IProductService {
get vscodeVersion(): string { return '1.35.0'; } // {{SQL CARBON EDIT}} add vscodeversion
get recommendedExtensionsByScenario(): { [area: string]: Array<string> } { return this.productConfiguration.recommendedExtensionsByScenario; }// {{SQL CARBON EDIT}} add getter
get recommendedExtensionsByScenario(): { [area: string]: Array<string> } { return this.productConfiguration ? this.productConfiguration.recommendedExtensionsByScenario : {}; }// {{SQL CARBON EDIT}} add getter
get commit(): string | undefined { return this.productConfiguration ? this.productConfiguration.commit : undefined; }

View File

@@ -73,7 +73,7 @@ export class AppInsightsAppender implements ITelemetryAppender {
});
}
flush(): Promise<any> | undefined {
flush(): Promise<any> {
if (this._aiClient) {
return new Promise(resolve => {
this._aiClient!.flush({
@@ -85,6 +85,6 @@ export class AppInsightsAppender implements ITelemetryAppender {
});
});
}
return undefined;
return Promise.resolve(undefined);
}
}