refactor(compiler): ensure compatibility with typescript strict flag (#30993)
As part of FW-1265, the `@angular/compiler` package is made compatible with the TypeScript `--strict` flag. This already unveiled a few bugs, so the strictness flag seems to help with increasing the overall code health. Read more about the strict flag [here](https://www.typescriptlang.org/docs/handbook/compiler-options.html) PR Close #30993
This commit is contained in:

committed by
Miško Hevery

parent
2200884e55
commit
012b535147
@ -132,7 +132,7 @@ export class StaticReflector implements CompileReflector {
|
||||
|
||||
public tryAnnotations(type: StaticSymbol): any[] {
|
||||
const originalRecorder = this.errorRecorder;
|
||||
this.errorRecorder = (error: any, fileName: string) => {};
|
||||
this.errorRecorder = (error: any, fileName?: string) => {};
|
||||
try {
|
||||
return this.annotations(type);
|
||||
} finally {
|
||||
@ -429,7 +429,7 @@ export class StaticReflector implements CompileReflector {
|
||||
*/
|
||||
private trySimplify(context: StaticSymbol, value: any): any {
|
||||
const originalRecorder = this.errorRecorder;
|
||||
this.errorRecorder = (error: any, fileName: string) => {};
|
||||
this.errorRecorder = (error: any, fileName?: string) => {};
|
||||
const result = this.simplify(context, value);
|
||||
this.errorRecorder = originalRecorder;
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user