@@ -10,11 +10,9 @@ import './ng_dev_mode';
10
10
11
11
import { Type } from '../core' ;
12
12
import { assertEqual , assertLessThan , assertNotEqual , assertNotNull } from './assert' ;
13
- import {
14
- CSSSelector , ContainerState , InitialInputData , InitialInputs , LContainer , LContainerStatic , LElement , LNode ,
15
- LNodeFlags , LNodeInjector , LNodeStatic , LProjection , LText , LView , MinificationData , MinificationDataValue ,
16
- ProjectionState , QueryState , ViewState , NgStaticData
17
- } from './interfaces' ;
13
+ import { CssSelector , ContainerState , ProjectionState , QueryState , ViewState } from './interfaces' ;
14
+ import { LText , LView , LElement , LNode , LNodeFlags , LNodeInjector , LContainer , LProjection } from './l_node' ;
15
+ import { NgStaticData , LNodeStatic , LContainerStatic , InitialInputData , InitialInputs , PropertyAliases , PropertyAliasValue , } from './l_node_static' ;
18
16
import { assertNodeType } from './node_assert' ;
19
17
import { appendChild , insertChild , insertView , processProjectedNode , removeView } from './node_manipulation' ;
20
18
import { isNodeMatchingSelector } from './node_selector_matcher' ;
@@ -439,7 +437,7 @@ export function listenerCreate(
439
437
// if we create LNodeStatic here, inputs must be undefined so we know they still need to be
440
438
// checked
441
439
mergeData . outputs = null ;
442
- mergeData = generateMinifiedData ( node . flags , mergeData ) ;
440
+ mergeData = generatePropertyAliases ( node . flags , mergeData ) ;
443
441
}
444
442
445
443
const outputs = mergeData . outputs ;
@@ -474,7 +472,7 @@ export function elementEnd() {
474
472
}
475
473
ngDevMode && assertNodeType ( previousOrParentNode , LNodeFlags . Element ) ;
476
474
const query = previousOrParentNode . query ;
477
- query && query . add ( previousOrParentNode ) ;
475
+ query && query . addNode ( previousOrParentNode ) ;
478
476
}
479
477
480
478
/**
@@ -525,11 +523,11 @@ export function elementProperty<T>(index: number, propName: string, value: T | N
525
523
if ( staticData . inputs === undefined ) {
526
524
// mark inputs as checked
527
525
staticData . inputs = null ;
528
- staticData = generateMinifiedData ( node . flags , staticData , true ) ;
526
+ staticData = generatePropertyAliases ( node . flags , staticData , true ) ;
529
527
}
530
528
531
529
const inputData = staticData . inputs ;
532
- let dataValue : MinificationDataValue | null ;
530
+ let dataValue : PropertyAliasValue | null ;
533
531
if ( inputData && ( dataValue = inputData [ propName ] ) ) {
534
532
setInputsForProperty ( dataValue , value ) ;
535
533
} else {
@@ -572,22 +570,22 @@ function setInputsForProperty(inputs: (number | string)[], value: any): void {
572
570
*
573
571
* @param index Index where data should be stored in ngStaticData
574
572
*/
575
- function generateMinifiedData ( flags : number , data : LNodeStatic , isInputData = false ) : LNodeStatic {
573
+ function generatePropertyAliases ( flags : number , data : LNodeStatic , isInputData = false ) : LNodeStatic {
576
574
const start = flags >> LNodeFlags . INDX_SHIFT ;
577
575
const size = ( flags & LNodeFlags . SIZE_MASK ) >> LNodeFlags . SIZE_SHIFT ;
578
576
579
577
for ( let i = start , ii = start + size ; i < ii ; i ++ ) {
580
578
const directiveDef : DirectiveDef < any > = ngStaticData ! [ i ] as DirectiveDef < any > ;
581
- const minifiedPropertyMap : { [ minifiedKey : string ] : string } =
579
+ const propertyAliasMap : { [ publicName : string ] : string } =
582
580
isInputData ? directiveDef . inputs : directiveDef . outputs ;
583
- for ( let unminifiedKey in minifiedPropertyMap ) {
584
- if ( minifiedPropertyMap . hasOwnProperty ( unminifiedKey ) ) {
585
- const minifiedKey = minifiedPropertyMap [ unminifiedKey ] ;
586
- const staticDirData : MinificationData = isInputData ? ( data . inputs || ( data . inputs = { } ) ) :
581
+ for ( let publicName in propertyAliasMap ) {
582
+ if ( propertyAliasMap . hasOwnProperty ( publicName ) ) {
583
+ const internalName = propertyAliasMap [ publicName ] ;
584
+ const staticDirData : PropertyAliases = isInputData ? ( data . inputs || ( data . inputs = { } ) ) :
587
585
( data . outputs || ( data . outputs = { } ) ) ;
588
- const hasProperty : boolean = staticDirData . hasOwnProperty ( unminifiedKey ) ;
589
- hasProperty ? staticDirData [ unminifiedKey ] . push ( i , minifiedKey ) :
590
- ( staticDirData [ unminifiedKey ] = [ i , minifiedKey ] ) ;
586
+ const hasProperty : boolean = staticDirData . hasOwnProperty ( publicName ) ;
587
+ hasProperty ? staticDirData [ publicName ] . push ( i , internalName ) :
588
+ ( staticDirData [ publicName ] = [ i , internalName ] ) ;
591
589
}
592
590
}
593
591
}
@@ -851,9 +849,9 @@ export function containerCreate(
851
849
index : number , template ?: ComponentTemplate < any > , tagName ?: string , attrs ?: string [ ] ) : void {
852
850
ngDevMode && assertEqual ( currentView . bindingStartIndex , null , 'bindingStartIndex' ) ;
853
851
854
- // If the direct parent of the container is a view, its children (including its comment)
852
+ // If the direct parent of the container is a view, its views (including its comment)
855
853
// will need to be added through insertView() when its parent view is being inserted.
856
- // For now, it is marked "headless" so we know to append its children later.
854
+ // For now, it is marked "headless" so we know to append its views later.
857
855
let comment = renderer . createComment ( ngDevMode ? 'container' : '' ) ;
858
856
let renderParent : LElement | null = null ;
859
857
const currentParent = isParent ? previousOrParentNode : previousOrParentNode . parent ! ;
@@ -866,7 +864,7 @@ export function containerCreate(
866
864
}
867
865
868
866
const node = createLNode ( index , LNodeFlags . Container , comment , < ContainerState > {
869
- children : [ ] ,
867
+ views : [ ] ,
870
868
nextIndex : 0 , renderParent,
871
869
template : template == null ? null : template ,
872
870
next : null ,
@@ -922,7 +920,7 @@ export function refreshContainerEnd(): void {
922
920
const container = previousOrParentNode as LContainer ;
923
921
ngDevMode && assertNodeType ( container , LNodeFlags . Container ) ;
924
922
const nextIndex = container . data . nextIndex ;
925
- while ( nextIndex < container . data . children . length ) {
923
+ while ( nextIndex < container . data . views . length ) {
926
924
// remove extra view.
927
925
removeView ( container , nextIndex ) ;
928
926
}
@@ -938,14 +936,14 @@ export function viewCreate(viewBlockId: number): boolean {
938
936
const container = ( isParent ? previousOrParentNode : previousOrParentNode . parent ! ) as LContainer ;
939
937
ngDevMode && assertNodeType ( container , LNodeFlags . Container ) ;
940
938
const containerState = container . data ;
941
- const children = containerState . children ;
939
+ const views = containerState . views ;
942
940
943
- const existingView : LView | false = ! creationMode && containerState . nextIndex < children . length &&
944
- children [ containerState . nextIndex ] ;
941
+ const existingView : LView | false = ! creationMode && containerState . nextIndex < views . length &&
942
+ views [ containerState . nextIndex ] ;
945
943
let viewUpdateMode = existingView && viewBlockId === ( existingView as LView ) . data . id ;
946
944
947
945
if ( viewUpdateMode ) {
948
- previousOrParentNode = children [ containerState . nextIndex ++ ] ;
946
+ previousOrParentNode = views [ containerState . nextIndex ++ ] ;
949
947
ngDevMode && assertNodeType ( previousOrParentNode , LNodeFlags . View ) ;
950
948
isParent = true ;
951
949
enterView ( ( existingView as LView ) . data , previousOrParentNode as LView ) ;
@@ -990,8 +988,8 @@ export function viewEnd(): void {
990
988
ngDevMode && assertNodeType ( viewNode , LNodeFlags . View ) ;
991
989
ngDevMode && assertNodeType ( container , LNodeFlags . Container ) ;
992
990
const containerState = container . data ;
993
- const previousView = containerState . nextIndex <= containerState . children . length ?
994
- containerState . children [ containerState . nextIndex - 1 ] as LView :
991
+ const previousView = containerState . nextIndex <= containerState . views . length ?
992
+ containerState . views [ containerState . nextIndex - 1 ] as LView :
995
993
null ;
996
994
const viewIdChanged = previousView == null ? true : previousView . data . id !== viewNode . data . id ;
997
995
@@ -1033,9 +1031,9 @@ export const refreshComponent:
1033
1031
* each projected node belongs (it re-distributes nodes among "buckets" where each "bucket" is
1034
1032
* backed by a selector).
1035
1033
*
1036
- * @param {CSSSelector [] } selectors
1034
+ * @param {CssSelector [] } selectors
1037
1035
*/
1038
- export function distributeProjectedNodes ( selectors ?: CSSSelector [ ] ) : LNode [ ] [ ] {
1036
+ export function distributeProjectedNodes ( selectors ?: CssSelector [ ] ) : LNode [ ] [ ] {
1039
1037
const noOfNodeBuckets = selectors ? selectors . length + 1 : 1 ;
1040
1038
const distributedNodes = new Array < LNode [ ] > ( noOfNodeBuckets ) ;
1041
1039
for ( let i = 0 ; i < noOfNodeBuckets ; i ++ ) {
0 commit comments