docs(ivy): Clean up incorrect comments (#23345)

PR Close #23345
This commit is contained in:
Misko Hevery 2018-04-12 16:02:33 -07:00 committed by Igor Minar
parent da31db757b
commit 4384a92271

View File

@ -64,12 +64,12 @@ interface Record<T> {
} }
/** /**
* Create a new `Injector` which is configured using `InjectorDefType`s. * Create a new `Injector` which is configured using `InjectorType`s.
* *
* @experimental * @experimental
*/ */
export function createInjector( export function createInjector(
defType: /* InjectorDefType<any> */ any, parent: Injector | null = null): Injector { defType: /* InjectorType<any> */ any, parent: Injector | null = null): Injector {
parent = parent || getNullInjector(); parent = parent || getNullInjector();
return new R3Injector(defType, parent); return new R3Injector(defType, parent);
} }
@ -81,7 +81,7 @@ export class R3Injector {
private records = new Map<Type<any>|InjectionToken<any>, Record<any>>(); private records = new Map<Type<any>|InjectionToken<any>, Record<any>>();
/** /**
* The transitive set of `InjectorDefType`s which define this injector. * The transitive set of `InjectorType`s which define this injector.
*/ */
private injectorDefTypes = new Set<InjectorType<any>>(); private injectorDefTypes = new Set<InjectorType<any>>();
@ -102,7 +102,7 @@ export class R3Injector {
private destroyed = false; private destroyed = false;
constructor(def: InjectorType<any>, readonly parent: Injector) { constructor(def: InjectorType<any>, readonly parent: Injector) {
// Start off by creating Records for every provider declared in every InjectorDefType // Start off by creating Records for every provider declared in every InjectorType
// included transitively in `def`. // included transitively in `def`.
deepForEach( deepForEach(
[def], injectorDef => this.processInjectorType(injectorDef, new Set<InjectorType<any>>())); [def], injectorDef => this.processInjectorType(injectorDef, new Set<InjectorType<any>>()));
@ -114,7 +114,7 @@ export class R3Injector {
// any injectable scoped to APP_ROOT_SCOPE. // any injectable scoped to APP_ROOT_SCOPE.
this.isRootInjector = this.records.has(APP_ROOT); this.isRootInjector = this.records.has(APP_ROOT);
// Eagerly instantiate the InjectorDefType classes themselves. // Eagerly instantiate the InjectorType classes themselves.
this.injectorDefTypes.forEach(defType => this.get(defType)); this.injectorDefTypes.forEach(defType => this.get(defType));
} }
@ -187,7 +187,7 @@ export class R3Injector {
} }
/** /**
* Add an `InjectorDefType` or `InjectorDefTypeWithProviders` and all of its transitive providers * Add an `InjectorType` or `InjectorDefTypeWithProviders` and all of its transitive providers
* to this injector. * to this injector.
*/ */
private processInjectorType( private processInjectorType(
@ -195,7 +195,7 @@ export class R3Injector {
parents: Set<InjectorType<any>>) { parents: Set<InjectorType<any>>) {
defOrWrappedDef = resolveForwardRef(defOrWrappedDef); defOrWrappedDef = resolveForwardRef(defOrWrappedDef);
// Either the defOrWrappedDef is an InjectorDefType (with ngInjectorDef) or an // Either the defOrWrappedDef is an InjectorType (with ngInjectorDef) or an
// InjectorDefTypeWithProviders (aka ModuleWithProviders). Detecting either is a megamorphic // InjectorDefTypeWithProviders (aka ModuleWithProviders). Detecting either is a megamorphic
// read, so care is taken to only do the read once. // read, so care is taken to only do the read once.
@ -206,7 +206,7 @@ export class R3Injector {
const ngModule = const ngModule =
(def == null) && (defOrWrappedDef as InjectorTypeWithProviders<any>).ngModule || undefined; (def == null) && (defOrWrappedDef as InjectorTypeWithProviders<any>).ngModule || undefined;
// Determine the InjectorDefType. In the case where `defOrWrappedDef` is an `InjectorDefType`, // Determine the InjectorType. In the case where `defOrWrappedDef` is an `InjectorType`,
// then this is easy. In the case of an InjectorDefTypeWithProviders, then the definition type // then this is easy. In the case of an InjectorDefTypeWithProviders, then the definition type
// is the `ngModule`. // is the `ngModule`.
const defType: InjectorType<any> = const defType: InjectorType<any> =
@ -234,7 +234,7 @@ export class R3Injector {
throw new Error(`Circular dependency: type ${stringify(defType)} ends up importing itself.`); throw new Error(`Circular dependency: type ${stringify(defType)} ends up importing itself.`);
} }
// Track the InjectorDefType and add a provider for it. // Track the InjectorType and add a provider for it.
this.injectorDefTypes.add(defType); this.injectorDefTypes.add(defType);
this.records.set(defType, makeRecord(def.factory)); this.records.set(defType, makeRecord(def.factory));