build: TypeScript 3.6 compatibility. (#32908)
This PR updates Angular to compile with TypeScript 3.6 while retaining compatibility with TS3.5. We achieve this by inserting several `as any` casts for compatiblity around `ts.CompilerHost` APIs. PR Close #32908
This commit is contained in:
@ -268,8 +268,9 @@ export class TestBedRender3 implements TestBed {
|
||||
if (token as unknown === TestBedRender3) {
|
||||
return this as any;
|
||||
}
|
||||
const result = this.testModuleRef.injector.get(token, UNDEFINED, flags);
|
||||
return result === UNDEFINED ? this.compiler.injector.get(token, notFoundValue, flags) : result;
|
||||
const result = this.testModuleRef.injector.get(token, UNDEFINED as{}, flags);
|
||||
return result === UNDEFINED ? this.compiler.injector.get(token, notFoundValue, flags) as any :
|
||||
result;
|
||||
}
|
||||
|
||||
/** @deprecated from v9.0.0 use TestBed.inject */
|
||||
|
@ -480,7 +480,8 @@ export class TestBedViewEngine implements TestBed {
|
||||
// Tests can inject things from the ng module and from the compiler,
|
||||
// but the ng module can't inject things from the compiler and vice versa.
|
||||
const result = this._moduleRef.injector.get(token, UNDEFINED, flags);
|
||||
return result === UNDEFINED ? this._compiler.injector.get(token, notFoundValue, flags) : result;
|
||||
return result === UNDEFINED ? this._compiler.injector.get(token, notFoundValue, flags) as any :
|
||||
result;
|
||||
}
|
||||
|
||||
/** @deprecated from v9.0.0 use TestBed.inject */
|
||||
|
Reference in New Issue
Block a user