refactor(core): ensure compatibility with typescript strict flag (#30993)

As part of FW-1265, the `@angular/core` 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:
Paul Gschwendtner
2019-06-14 09:27:41 +02:00
committed by Miško Hevery
parent 78e7fdd98d
commit 2200884e55
29 changed files with 122 additions and 86 deletions

View File

@ -132,7 +132,7 @@ export class NodeInjectorFactory {
/**
* The inject implementation to be activated when using the factory.
*/
injectImpl: null|(<T>(token: Type<T>|InjectionToken<T>, flags: InjectFlags) => T);
injectImpl: null|(<T>(token: Type<T>|InjectionToken<T>, flags?: InjectFlags) => T);
/**
* Marker set to true during factory invocation to see if we get into recursive loop.
@ -216,7 +216,7 @@ export class NodeInjectorFactory {
* Factory to invoke in order to create a new instance.
*/
public factory:
(this: NodeInjectorFactory, _: null,
(this: NodeInjectorFactory, _: undefined,
/**
* array where injectables tokens are stored. This is used in
* case of an error reporting to produce friendlier errors.
@ -234,8 +234,8 @@ export class NodeInjectorFactory {
/**
* Set to `true` if the token is declared in `viewProviders` (or if it is component).
*/
isViewProvider: boolean,
injectImplementation: null|(<T>(token: Type<T>|InjectionToken<T>, flags: InjectFlags) => T)) {
isViewProvider: boolean, injectImplementation: null|
(<T>(token: Type<T>|InjectionToken<T>, flags?: InjectFlags) => T)) {
this.canSeeViewProviders = isViewProvider;
this.injectImpl = injectImplementation;
}