@@ -22,7 +22,7 @@ import {assertGreaterThan, assertLessThan, assertNotNull} from './assert';
2222import { addToViewTree , assertPreviousIsParent , createLContainer , createLNodeObject , createTNode , createTView , getDirectiveInstance , getPreviousOrParentNode , getRenderer , isComponent , renderEmbeddedTemplate , resolveDirective } from './instructions' ;
2323import { ComponentTemplate , DirectiveDef , DirectiveDefList , PipeDefList } from './interfaces/definition' ;
2424import { LInjector } from './interfaces/injector' ;
25- import { LContainerNode , LElementNode , LNode , LNodeType , LViewNode , TNodeFlags } from './interfaces/node' ;
25+ import { LContainerNode , LElementNode , LNode , LViewNode , TNodeFlags , TNodeType } from './interfaces/node' ;
2626import { QueryReadType } from './interfaces/query' ;
2727import { Renderer3 } from './interfaces/renderer' ;
2828import { LView , TView } from './interfaces/view' ;
@@ -253,7 +253,7 @@ export function injectChangeDetectorRef(): viewEngine_ChangeDetectorRef {
253253export function injectAttribute ( attrName : string ) : string | undefined {
254254 ngDevMode && assertPreviousIsParent ( ) ;
255255 const lElement = getPreviousOrParentNode ( ) as LElementNode ;
256- ngDevMode && assertNodeType ( lElement , LNodeType . Element ) ;
256+ ngDevMode && assertNodeType ( lElement , TNodeType . Element ) ;
257257 const tElement = lElement . tNode ;
258258 ngDevMode && assertNotNull ( tElement , 'expecting tNode' ) ;
259259 const attrs = tElement . attrs ;
@@ -280,7 +280,7 @@ export function getOrCreateChangeDetectorRef(
280280 const currentNode = di . node ;
281281 if ( isComponent ( currentNode . tNode ) ) {
282282 return di . changeDetectorRef = createViewRef ( currentNode . data as LView , context ) ;
283- } else if ( currentNode . type === LNodeType . Element ) {
283+ } else if ( currentNode . tNode . type === TNodeType . Element ) {
284284 return di . changeDetectorRef = getOrCreateHostChangeDetector ( currentNode . view . node ) ;
285285 }
286286 return null ! ;
@@ -307,7 +307,7 @@ function getOrCreateHostChangeDetector(currentNode: LViewNode | LElementNode):
307307 * returns itself.
308308 */
309309function getClosestComponentAncestor ( node : LViewNode | LElementNode ) : LElementNode {
310- while ( node . type === LNodeType . View ) {
310+ while ( node . tNode . type === TNodeType . View ) {
311311 node = node . view . node ;
312312 }
313313 return node as LElementNode ;
@@ -523,7 +523,7 @@ export class ReadFromInjectorFn<T> {
523523 */
524524export function getOrCreateElementRef ( di : LInjector ) : viewEngine_ElementRef {
525525 return di . elementRef || ( di . elementRef = new ElementRef (
526- di . node . type === LNodeType . Container ? null : di . node . native ) ) ;
526+ di . node . tNode . type === TNodeType . Container ? null : di . node . native ) ) ;
527527}
528528
529529export const QUERY_READ_TEMPLATE_REF = < QueryReadType < viewEngine_TemplateRef < any > > > (
@@ -540,12 +540,12 @@ export const QUERY_READ_ELEMENT_REF =
540540
541541export const QUERY_READ_FROM_NODE =
542542 ( new ReadFromInjectorFn < any > ( ( injector : LInjector , node : LNode , directiveIdx : number ) => {
543- ngDevMode && assertNodeOfPossibleTypes ( node , LNodeType . Container , LNodeType . Element ) ;
543+ ngDevMode && assertNodeOfPossibleTypes ( node , TNodeType . Container , TNodeType . Element ) ;
544544 if ( directiveIdx > - 1 ) {
545545 return node . view . directives ! [ directiveIdx ] ;
546- } else if ( node . type === LNodeType . Element ) {
546+ } else if ( node . tNode . type === TNodeType . Element ) {
547547 return getOrCreateElementRef ( injector ) ;
548- } else if ( node . type === LNodeType . Container ) {
548+ } else if ( node . tNode . type === TNodeType . Container ) {
549549 return getOrCreateTemplateRef ( injector ) ;
550550 }
551551 throw new Error ( 'fail' ) ;
@@ -567,14 +567,15 @@ export function getOrCreateContainerRef(di: LInjector): viewEngine_ViewContainer
567567 if ( ! di . viewContainerRef ) {
568568 const vcRefHost = di . node ;
569569
570- ngDevMode && assertNodeOfPossibleTypes ( vcRefHost , LNodeType . Container , LNodeType . Element ) ;
570+ ngDevMode && assertNodeOfPossibleTypes ( vcRefHost , TNodeType . Container , TNodeType . Element ) ;
571571 const lContainer = createLContainer ( vcRefHost . parent ! , vcRefHost . view ) ;
572572 const lContainerNode : LContainerNode = createLNodeObject (
573- LNodeType . Container , vcRefHost . view , vcRefHost . parent ! , undefined , lContainer , null ) ;
573+ TNodeType . Container , vcRefHost . view , vcRefHost . parent ! , undefined , lContainer , null ) ;
574574
575575 const hostTNode = vcRefHost . tNode ;
576576 if ( ! hostTNode . dynamicContainerNode ) {
577- hostTNode . dynamicContainerNode = createTNode ( hostTNode . index , null , null , null ) ;
577+ hostTNode . dynamicContainerNode =
578+ createTNode ( TNodeType . Container , hostTNode . index , null , null , null ) ;
578579 }
579580
580581 lContainerNode . tNode = hostTNode . dynamicContainerNode ;
@@ -650,7 +651,7 @@ class ViewContainerRef implements viewEngine_ViewContainerRef {
650651 // Look for the parent node and increment its dynamic view count.
651652 if ( this . _lContainerNode . parent !== null && this . _lContainerNode . parent . data !== null ) {
652653 ngDevMode && assertNodeOfPossibleTypes (
653- this . _lContainerNode . parent , LNodeType . View , LNodeType . Element ) ;
654+ this . _lContainerNode . parent , TNodeType . View , TNodeType . Element ) ;
654655 this . _lContainerNode . parent . data . dynamicViewCount ++ ;
655656 }
656657 }
@@ -701,7 +702,7 @@ class ViewContainerRef implements viewEngine_ViewContainerRef {
701702 */
702703export function getOrCreateTemplateRef < T > ( di : LInjector ) : viewEngine_TemplateRef < T > {
703704 if ( ! di . templateRef ) {
704- ngDevMode && assertNodeType ( di . node , LNodeType . Container ) ;
705+ ngDevMode && assertNodeType ( di . node , TNodeType . Container ) ;
705706 const hostNode = di . node as LContainerNode ;
706707 const hostTNode = hostNode . tNode ;
707708 const hostTView = hostNode . view . tView ;
0 commit comments