refactor(ivy): rename `PipeDef.n` to `PipeDef.factory` (#23883)

The original reason for this property to be short no longer holds true,
as pipes always need to be defined using `definePipe`.

PR Close #23883
This commit is contained in:
JoostK 2018-05-13 18:29:45 +02:00 committed by Victor Berchet
parent e53179ef8c
commit b87d650da2
3 changed files with 4 additions and 7 deletions

View File

@ -431,7 +431,7 @@ export function definePipe<T>(pipeDef: {
}): never { }): never {
return (<PipeDef<T>>{ return (<PipeDef<T>>{
name: pipeDef.name, name: pipeDef.name,
n: pipeDef.factory, factory: pipeDef.factory,
pure: pipeDef.pure !== false, pure: pipeDef.pure !== false,
onDestroy: pipeDef.type.prototype.ngOnDestroy || null onDestroy: pipeDef.type.prototype.ngOnDestroy || null
}) as never; }) as never;

View File

@ -204,12 +204,9 @@ export interface PipeDef<T> {
name: string; name: string;
/** /**
* factory function used to create a new directive instance. * Factory function used to create a new pipe instance.
*
* NOTE: this property is short (1 char) because it is used in
* component templates which is sensitive to size.
*/ */
n: () => T; factory: () => T;
/** /**
* Whether or not the pipe is pure. * Whether or not the pipe is pure.

View File

@ -33,7 +33,7 @@ export function pipe(index: number, pipeName: string): any {
pipeDef = tView.data[index] as PipeDef<any>; pipeDef = tView.data[index] as PipeDef<any>;
} }
const pipeInstance = pipeDef.n(); const pipeInstance = pipeDef.factory();
store(index, pipeInstance); store(index, pipeInstance);
return pipeInstance; return pipeInstance;
} }