2016-06-23 09:47:54 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/ * *  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  @license 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-19 12:08:49 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  Copyright  Google  LLC  All  Rights  Reserved . 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-23 09:47:54 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  Use  of  this  source  code  is  governed  by  an  MIT - style  license  that  can  be 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  found  in  the  LICENSE  file  at  https : //angular.io/license
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * / 
							 
						 
					
						
							
								
									
										
											 
										
											
												test(compiler): add expression absolute span tests for `TemplateAst`s (#33253)
Previously, we had tested that expressions parsed in a Render3 AST
had correctly-defined absolute spans (spans relative to the entire
template, not the local expression). Sometimes we use Template ASTs
rather than Render3 ASTs, and it's desirable to test for correct
expression spans in the template parser as well.
Adding these tests resolved one bug, similar to the one fixed in
fd4fed14d8935866fe16d30648d115f3ebb5fd43, where expressions in the value
of a template attribute were not given an absolute span corresponding to
the start of the attribute name rather than the start of the attribute
value.
The diff on this commit is large, partially because it involves some
structural changes of the template parser testing layout. In particular,
the following is done:
1. Move `createMeta*`-like functions from `template_parser_spec.ts` to
   be exported from a new test utility file.
2. Create an `ExpressionSourceHumanizer`, similar to the one created in
   b04488d692ca11c83444da56f51d53c3ac868243, to allow convenient testing
   of expressions' locations.
3. Create `template_parser_absolute_span_spec.ts`, testing the spans of
   expressions parsed by the template parser. This is very similar to
   the `r3_ast_absolute_span_spec`.
PR Close #33253
											 
										 
										
											2019-10-18 09:51:20 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { preserveWhitespacesDefault }  from  '@angular/compiler' ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { CompileDiDependencyMetadata ,  CompileDirectiveMetadata ,  CompileDirectiveSummary ,  CompilePipeMetadata ,  CompilePipeSummary ,  CompileProviderMetadata ,  CompileTemplateMetadata ,  CompileTokenMetadata ,  tokenReference }  from  '@angular/compiler/src/compile_metadata' ;  
						 
					
						
							
								
									
										
										
										
											2016-05-26 14:35:27 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { DomElementSchemaRegistry }  from  '@angular/compiler/src/schema/dom_element_schema_registry' ;  
						 
					
						
							
								
									
										
										
										
											2016-06-08 16:38:52 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { ElementSchemaRegistry }  from  '@angular/compiler/src/schema/element_schema_registry' ;  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { AttrAst ,  BoundDirectivePropertyAst ,  BoundElementPropertyAst ,  BoundEventAst ,  BoundTextAst ,  DirectiveAst ,  ElementAst ,  EmbeddedTemplateAst ,  NgContentAst ,  PropertyBindingType ,  ProviderAstType ,  ReferenceAst ,  TemplateAst ,  TemplateAstVisitor ,  templateVisitAll ,  TextAst ,  VariableAst }  from  '@angular/compiler/src/template_parser/template_ast' ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { splitClasses ,  TemplateParser }  from  '@angular/compiler/src/template_parser/template_parser' ;  
						 
					
						
							
								
									
										
											 
										
											
												test(compiler): add expression absolute span tests for `TemplateAst`s (#33253)
Previously, we had tested that expressions parsed in a Render3 AST
had correctly-defined absolute spans (spans relative to the entire
template, not the local expression). Sometimes we use Template ASTs
rather than Render3 ASTs, and it's desirable to test for correct
expression spans in the template parser as well.
Adding these tests resolved one bug, similar to the one fixed in
fd4fed14d8935866fe16d30648d115f3ebb5fd43, where expressions in the value
of a template attribute were not given an absolute span corresponding to
the start of the attribute name rather than the start of the attribute
value.
The diff on this commit is large, partially because it involves some
structural changes of the template parser testing layout. In particular,
the following is done:
1. Move `createMeta*`-like functions from `template_parser_spec.ts` to
   be exported from a new test utility file.
2. Create an `ExpressionSourceHumanizer`, similar to the one created in
   b04488d692ca11c83444da56f51d53c3ac868243, to allow convenient testing
   of expressions' locations.
3. Create `template_parser_absolute_span_spec.ts`, testing the spans of
   expressions parsed by the template parser. This is very similar to
   the `r3_ast_absolute_span_spec`.
PR Close #33253
											 
										 
										
											2019-10-18 09:51:20 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { SchemaMetadata ,  SecurityContext }  from  '@angular/core' ;  
						 
					
						
							
								
									
										
										
										
											2016-06-08 16:38:52 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { Console }  from  '@angular/core/src/console' ;  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { inject ,  TestBed }  from  '@angular/core/testing' ;  
						 
					
						
							
								
									
										
										
										
											2017-08-16 09:00:03 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { JitReflector }  from  '@angular/platform-browser-dynamic/src/compiler_reflector' ;  
						 
					
						
							
								
									
										
										
										
											2016-11-10 16:27:53 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { createTokenForExternalReference ,  createTokenForReference ,  Identifiers }  from  '../../src/identifiers' ;  
						 
					
						
							
								
									
										
										
										
											2016-08-01 12:19:09 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { DEFAULT_INTERPOLATION_CONFIG ,  InterpolationConfig }  from  '../../src/ml_parser/interpolation_config' ;  
						 
					
						
							
								
									
										
											 
										
											
												test(compiler): add expression absolute span tests for `TemplateAst`s (#33253)
Previously, we had tested that expressions parsed in a Render3 AST
had correctly-defined absolute spans (spans relative to the entire
template, not the local expression). Sometimes we use Template ASTs
rather than Render3 ASTs, and it's desirable to test for correct
expression spans in the template parser as well.
Adding these tests resolved one bug, similar to the one fixed in
fd4fed14d8935866fe16d30648d115f3ebb5fd43, where expressions in the value
of a template attribute were not given an absolute span corresponding to
the start of the attribute name rather than the start of the attribute
value.
The diff on this commit is large, partially because it involves some
structural changes of the template parser testing layout. In particular,
the following is done:
1. Move `createMeta*`-like functions from `template_parser_spec.ts` to
   be exported from a new test utility file.
2. Create an `ExpressionSourceHumanizer`, similar to the one created in
   b04488d692ca11c83444da56f51d53c3ac868243, to allow convenient testing
   of expressions' locations.
3. Create `template_parser_absolute_span_spec.ts`, testing the spans of
   expressions parsed by the template parser. This is very similar to
   the `r3_ast_absolute_span_spec`.
PR Close #33253
											 
										 
										
											2019-10-18 09:51:20 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { newArray }  from  '../../src/util' ;  
						 
					
						
							
								
									
										
										
										
											2017-03-02 12:12:46 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { MockSchemaRegistry }  from  '../../testing' ;  
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { unparse }  from  '../expression_parser/utils/unparser' ;  
						 
					
						
							
								
									
										
										
										
											2017-08-16 09:00:03 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { TEST_COMPILER_PROVIDERS }  from  '../test_bindings' ;  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												test(compiler): add expression absolute span tests for `TemplateAst`s (#33253)
Previously, we had tested that expressions parsed in a Render3 AST
had correctly-defined absolute spans (spans relative to the entire
template, not the local expression). Sometimes we use Template ASTs
rather than Render3 ASTs, and it's desirable to test for correct
expression spans in the template parser as well.
Adding these tests resolved one bug, similar to the one fixed in
fd4fed14d8935866fe16d30648d115f3ebb5fd43, where expressions in the value
of a template attribute were not given an absolute span corresponding to
the start of the attribute name rather than the start of the attribute
value.
The diff on this commit is large, partially because it involves some
structural changes of the template parser testing layout. In particular,
the following is done:
1. Move `createMeta*`-like functions from `template_parser_spec.ts` to
   be exported from a new test utility file.
2. Create an `ExpressionSourceHumanizer`, similar to the one created in
   b04488d692ca11c83444da56f51d53c3ac868243, to allow convenient testing
   of expressions' locations.
3. Create `template_parser_absolute_span_spec.ts`, testing the spans of
   expressions parsed by the template parser. This is very similar to
   the `r3_ast_absolute_span_spec`.
PR Close #33253
											 
										 
										
											2019-10-18 09:51:20 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { compileDirectiveMetadataCreate ,  compileTemplateMetadata ,  createTypeMeta }  from  './util/metadata' ;  
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-23 10:52:40 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const  someModuleUrl  =  'package:someModule' ;  
						 
					
						
							
								
									
										
										
										
											2016-01-06 14:13:44 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-23 10:52:40 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const  MOCK_SCHEMA_REGISTRY  =  [ {  
						 
					
						
							
								
									
										
										
										
											2016-06-08 16:38:52 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  provide : ElementSchemaRegistry , 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-23 10:52:40 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  useValue : new  MockSchemaRegistry ( 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-28 02:10:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      { 'invalidProp' :  false } ,  { 'mappedAttr' :  'mappedProp' } ,  { 'unknown' :  false ,  'un-known' :  false } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ 'onEvent' ] ,  [ 'onEvent' ] ) , 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-08 16:38:52 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ] ;  
						 
					
						
							
								
									
										
										
										
											2016-02-10 16:54:32 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-24 09:59:58 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								function  humanizeTplAst (  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateAsts : TemplateAst [ ] ,  interpolationConfig? : InterpolationConfig ) :  any [ ]  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  humanizer  =  new  TemplateHumanizer ( false ,  interpolationConfig ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  templateVisitAll ( humanizer ,  templateAsts ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  return  humanizer . result ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								function  humanizeTplAstSourceSpans (  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateAsts : TemplateAst [ ] ,  interpolationConfig? : InterpolationConfig ) :  any [ ]  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  humanizer  =  new  TemplateHumanizer ( true ,  interpolationConfig ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  templateVisitAll ( humanizer ,  templateAsts ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  return  humanizer . result ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  TemplateHumanizer  implements  TemplateAstVisitor  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  result : any [ ]  =  [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  constructor ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      private  includeSourceSpan : boolean , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      private  interpolationConfig : InterpolationConfig  =  DEFAULT_INTERPOLATION_CONFIG )  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitNgContent ( ast : NgContentAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  res  =  [ NgContentAst ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    this . result . push ( this . _appendSourceSpan ( ast ,  res ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitEmbeddedTemplate ( ast : EmbeddedTemplateAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  res  =  [ EmbeddedTemplateAst ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    this . result . push ( this . _appendSourceSpan ( ast ,  res ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . attrs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . outputs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . references ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . variables ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . directives ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . children ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitElement ( ast : ElementAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  res  =  [ ElementAst ,  ast . name ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    this . result . push ( this . _appendSourceSpan ( ast ,  res ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . attrs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . inputs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . outputs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . references ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . directives ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . children ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitReference ( ast : ReferenceAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  res  =  [ ReferenceAst ,  ast . name ,  ast . value ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    this . result . push ( this . _appendSourceSpan ( ast ,  res ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitVariable ( ast : VariableAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  res  =  [ VariableAst ,  ast . name ,  ast . value ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    this . result . push ( this . _appendSourceSpan ( ast ,  res ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitEvent ( ast : BoundEventAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  res  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ BoundEventAst ,  ast . name ,  ast . target ,  unparse ( ast . handler ,  this . interpolationConfig ) ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    this . result . push ( this . _appendSourceSpan ( ast ,  res ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitElementProperty ( ast : BoundElementPropertyAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  res  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      BoundElementPropertyAst ,  ast . type ,  ast . name ,  unparse ( ast . value ,  this . interpolationConfig ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ast . unit 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    this . result . push ( this . _appendSourceSpan ( ast ,  res ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitAttr ( ast : AttrAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  res  =  [ AttrAst ,  ast . name ,  ast . value ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    this . result . push ( this . _appendSourceSpan ( ast ,  res ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitBoundText ( ast : BoundTextAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  res  =  [ BoundTextAst ,  unparse ( ast . value ,  this . interpolationConfig ) ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    this . result . push ( this . _appendSourceSpan ( ast ,  res ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitText ( ast : TextAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  res  =  [ TextAst ,  ast . value ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    this . result . push ( this . _appendSourceSpan ( ast ,  res ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitDirective ( ast : DirectiveAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  res  =  [ DirectiveAst ,  ast . directive ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    this . result . push ( this . _appendSourceSpan ( ast ,  res ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . inputs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . hostProperties ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . hostEvents ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitDirectiveProperty ( ast : BoundDirectivePropertyAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  res  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      BoundDirectivePropertyAst ,  ast . directiveName ,  unparse ( ast . value ,  this . interpolationConfig ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    this . result . push ( this . _appendSourceSpan ( ast ,  res ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-24 09:59:58 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-04-24 14:22:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  private  _appendSourceSpan ( ast : TemplateAst ,  input : any [ ] ) :  any [ ]  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  ( ! this . includeSourceSpan )  return  input ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-26 12:21:29 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    input . push ( ast . sourceSpan . toString ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  input ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								function  humanizeContentProjection ( templateAsts : TemplateAst [ ] ) :  any [ ]  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  const  humanizer  =  new  TemplateContentProjectionHumanizer ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  templateVisitAll ( humanizer ,  templateAsts ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  return  humanizer . result ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  TemplateContentProjectionHumanizer  implements  TemplateAstVisitor  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  result : any [ ]  =  [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitNgContent ( ast : NgContentAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    this . result . push ( [ 'ng-content' ,  ast . ngContentIndex ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitEmbeddedTemplate ( ast : EmbeddedTemplateAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    this . result . push ( [ 'template' ,  ast . ngContentIndex ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . children ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitElement ( ast : ElementAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    this . result . push ( [ ast . name ,  ast . ngContentIndex ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    templateVisitAll ( this ,  ast . children ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  visitReference ( ast : ReferenceAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitVariable ( ast : VariableAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitEvent ( ast : BoundEventAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitElementProperty ( ast : BoundElementPropertyAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitAttr ( ast : AttrAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  visitBoundText ( ast : BoundTextAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    this . result . push ( [ ` #text( ${ unparse ( ast . value ) } ) ` ,  ast . ngContentIndex ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitText ( ast : TextAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    this . result . push ( [ ` #text( ${ ast . value } ) ` ,  ast . ngContentIndex ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  visitDirective ( ast : DirectiveAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitDirectiveProperty ( ast : BoundDirectivePropertyAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  ThrowingVisitor  implements  TemplateAstVisitor  {  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  visitNgContent ( ast : NgContentAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    throw  'not implemented' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitEmbeddedTemplate ( ast : EmbeddedTemplateAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    throw  'not implemented' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitElement ( ast : ElementAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    throw  'not implemented' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitReference ( ast : ReferenceAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    throw  'not implemented' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitVariable ( ast : VariableAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    throw  'not implemented' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitEvent ( ast : BoundEventAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    throw  'not implemented' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitElementProperty ( ast : BoundElementPropertyAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    throw  'not implemented' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitAttr ( ast : AttrAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    throw  'not implemented' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitBoundText ( ast : BoundTextAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    throw  'not implemented' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitText ( ast : TextAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    throw  'not implemented' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitDirective ( ast : DirectiveAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    throw  'not implemented' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  visitDirectiveProperty ( ast : BoundDirectivePropertyAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    throw  'not implemented' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  FooAstTransformer  extends  ThrowingVisitor  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitElement ( ast : ElementAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  ( ast . name  !=  'div' )  return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  new  ElementAst ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        'foo' ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  false ,  [ ] ,  [ ] ,  ast . ngContentIndex ,  ast . sourceSpan , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ast . endSourceSpan ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  BarAstTransformer  extends  FooAstTransformer  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitElement ( ast : ElementAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  ( ast . name  !=  'foo' )  return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  new  ElementAst ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        'bar' ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  false ,  [ ] ,  [ ] ,  ast . ngContentIndex ,  ast . sourceSpan , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ast . endSourceSpan ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  NullVisitor  implements  TemplateAstVisitor  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitNgContent ( ast : NgContentAst ,  context : any ) :  any  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitEmbeddedTemplate ( ast : EmbeddedTemplateAst ,  context : any ) :  any  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitElement ( ast : ElementAst ,  context : any ) :  any  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitReference ( ast : ReferenceAst ,  context : any ) :  any  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitVariable ( ast : VariableAst ,  context : any ) :  any  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitEvent ( ast : BoundEventAst ,  context : any ) :  any  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitElementProperty ( ast : BoundElementPropertyAst ,  context : any ) :  any  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitAttr ( ast : AttrAst ,  context : any ) :  any  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitBoundText ( ast : BoundTextAst ,  context : any ) :  any  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitText ( ast : TextAst ,  context : any ) :  any  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitDirective ( ast : DirectiveAst ,  context : any ) :  any  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  visitDirectiveProperty ( ast : BoundDirectivePropertyAst ,  context : any ) :  any  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  ArrayConsole  implements  Console  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  logs : string [ ]  =  [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  warnings : string [ ]  =  [ ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  log ( msg : string )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    this . logs . push ( msg ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  warn ( msg : string )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    this . warnings . push ( msg ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 15:10:54 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( function ( )  {  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								let  ngIf : CompileDirectiveSummary ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								let  parse :  (  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    template : string ,  directives : CompileDirectiveSummary [ ] ,  pipes? : CompilePipeSummary [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    schemas? : SchemaMetadata [ ] ,  preserveWhitespaces? : boolean )  = >  TemplateAst [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								let  console : ArrayConsole ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								function  configureCompiler() {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  console  =  new  ArrayConsole ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  beforeEach ( ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    TestBed . configureCompiler ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      providers :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        { provide : Console ,  useValue : console } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] , 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-25 19:52:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2017-01-10 19:07:03 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								function  commonBeforeEach() {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  beforeEach ( inject ( [ TemplateParser ] ,  ( parser : TemplateParser )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  someAnimation  =  [ 'someAnimation' ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  someTemplate  =  compileTemplateMetadata ( { animations :  [ someAnimation ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  component  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      isHost : false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      selector :  'root' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      template : someTemplate , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'Root' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      isComponent : true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ngIf  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             selector :  '[ngIf]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             template : someTemplate , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'NgIf' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             inputs :  [ 'ngIf' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    parse  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ( template : string ,  directives : CompileDirectiveSummary [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         pipes : CompilePipeSummary [ ] | null  =  null ,  schemas : SchemaMetadata [ ]  =  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         preserveWhitespaces  =  true ) :  TemplateAst [ ]  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          if  ( pipes  ===  null )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pipes  =  [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          return  parser 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              . parse ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                  component ,  template ,  directives ,  pipes ,  schemas ,  'TestComp' ,  preserveWhitespaces ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              . template ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								describe ( 'TemplateAstVisitor' ,  ( )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  function  expectVisitedNode ( visitor : TemplateAstVisitor ,  node : TemplateAst )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expect ( node . visit ( visitor ,  null ) ) . toEqual ( node ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should visit NgContentAst' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expectVisitedNode ( new  class  extends  NullVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visitNgContent ( ast : NgContentAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ,  new  NgContentAst ( 0 ,  0 ,  null ! ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should visit EmbeddedTemplateAst' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expectVisitedNode ( new  class  extends  NullVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visitEmbeddedTemplate ( ast : EmbeddedTemplateAst ,  context : any )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ,  new  EmbeddedTemplateAst ( [ ] ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  false ,  [ ] ,  [ ] ,  0 ,  null ! ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should visit ElementAst' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expectVisitedNode ( new  class  extends  NullVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visitElement ( ast : ElementAst ,  context : any )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ,  new  ElementAst ( 'foo' ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  false ,  [ ] ,  [ ] ,  0 ,  null ! ,  null ! ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should visit RefererenceAst' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expectVisitedNode ( new  class  extends  NullVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visitReference ( ast : ReferenceAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ,  new  ReferenceAst ( 'foo' ,  null ! ,  null ! ,  null ! ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should visit VariableAst' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expectVisitedNode ( new  class  extends  NullVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visitVariable ( ast : VariableAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ,  new  VariableAst ( 'foo' ,  'bar' ,  null ! ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should visit BoundEventAst' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expectVisitedNode ( new  class  extends  NullVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visitEvent ( ast : BoundEventAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ,  new  BoundEventAst ( 'foo' ,  'bar' ,  'goo' ,  null ! ,  null ! ,  null ! ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should visit BoundElementPropertyAst' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expectVisitedNode ( new  class  extends  NullVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visitElementProperty ( ast : BoundElementPropertyAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ,  new  BoundElementPropertyAst ( 'foo' ,  null ! ,  null ! ,  null ! ,  'bar' ,  null ! ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should visit AttrAst' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expectVisitedNode ( new  class  extends  NullVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visitAttr ( ast : AttrAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ,  new  AttrAst ( 'foo' ,  'bar' ,  null ! ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should visit BoundTextAst' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expectVisitedNode ( new  class  extends  NullVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visitBoundText ( ast : BoundTextAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ,  new  BoundTextAst ( null ! ,  0 ,  null ! ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should visit TextAst' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expectVisitedNode ( new  class  extends  NullVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visitText ( ast : TextAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ,  new  TextAst ( 'foo' ,  0 ,  null ! ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should visit DirectiveAst' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expectVisitedNode ( new  class  extends  NullVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visitDirective ( ast : DirectiveAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ,  new  DirectiveAst ( null ! ,  [ ] ,  [ ] ,  [ ] ,  0 ,  null ! ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should visit DirectiveAst' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expectVisitedNode ( new  class  extends  NullVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visitDirectiveProperty ( ast : BoundDirectivePropertyAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ast ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ,  new  BoundDirectivePropertyAst ( 'foo' ,  'bar' ,  null ! ,  null ! ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should skip the typed call of a visitor if visit() returns a truthy value' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  visitor  =  new  class  extends  ThrowingVisitor  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      visit ( ast : TemplateAst ,  context : any ) :  any  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  nodes : TemplateAst [ ]  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      new  NgContentAst ( 0 ,  0 ,  null ! ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      new  EmbeddedTemplateAst ( [ ] ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  false ,  [ ] ,  [ ] ,  0 ,  null ! ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      new  ElementAst ( 'foo' ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  [ ] ,  false ,  [ ] ,  [ ] ,  0 ,  null ! ,  null ! ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      new  ReferenceAst ( 'foo' ,  null ! ,  'bar' ,  null ! ) ,  new  VariableAst ( 'foo' ,  'bar' ,  null ! ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      new  BoundEventAst ( 'foo' ,  'bar' ,  'goo' ,  null ! ,  null ! ,  null ! ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      new  BoundElementPropertyAst ( 'foo' ,  null ! ,  null ! ,  null ! ,  'bar' ,  null ! ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      new  AttrAst ( 'foo' ,  'bar' ,  null ! ) ,  new  BoundTextAst ( null ! ,  0 ,  null ! ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      new  TextAst ( 'foo' ,  0 ,  null ! ) ,  new  DirectiveAst ( null ! ,  [ ] ,  [ ] ,  [ ] ,  0 ,  null ! ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      new  BoundDirectivePropertyAst ( 'foo' ,  'bar' ,  null ! ,  null ! ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  result  =  templateVisitAll ( visitor ,  nodes ,  null ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expect ( result ) . toEqual ( newArray ( nodes . length ) . fill ( true ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								describe ( 'TemplateParser Security' ,  ( )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  // Semi-integration test to make sure TemplateParser properly sets the security context.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  // Uses the actual DomElementSchemaRegistry.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  beforeEach ( ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    TestBed . configureCompiler ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      providers :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        TEST_COMPILER_PROVIDERS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        { provide : ElementSchemaRegistry ,  useClass : DomElementSchemaRegistry ,  deps :  [ ] } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-11 15:46:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  configureCompiler ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  commonBeforeEach ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  describe ( 'security context' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    function  secContext ( tpl : string ) :  SecurityContext  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  ast  =  parse ( tpl ,  [ ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  propBinding  =  ( < ElementAst > ast [ 0 ] ) . inputs [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      return  propBinding . securityContext ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should set for properties' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( secContext ( '<div [title]="v">' ) ) . toBe ( SecurityContext . NONE ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( secContext ( '<div [innerHTML]="v">' ) ) . toBe ( SecurityContext . HTML ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should set for property value bindings' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( secContext ( '<div innerHTML="{{v}}">' ) ) . toBe ( SecurityContext . HTML ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should set for attributes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( secContext ( '<a [attr.href]="v">' ) ) . toBe ( SecurityContext . URL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      // NB: attributes below need to change case.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( secContext ( '<a [attr.innerHtml]="v">' ) ) . toBe ( SecurityContext . HTML ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( secContext ( '<a [attr.formaction]="v">' ) ) . toBe ( SecurityContext . URL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should set for style' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( secContext ( '<a [style.backgroundColor]="v">' ) ) . toBe ( SecurityContext . STYLE ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												feat(testing): add implicit test module
Every test now has an implicit module. It can be configured via `configureModule` (from @angular/core/testing)
to add providers, directives, pipes, ...
The compiler now has to be configured separately via `configureCompiler` (from @angular/core/testing)
to add providers or define whether to use jit.
BREAKING CHANGE:
- Application providers can no longer inject compiler internals (i.e. everything
  from `@angular/compiler). Inject `Compiler` instead. This reflects the
  changes to `bootstrap` for module support (3f55aa609f60f130f1d69188ed057214b1267cb3).
- Compiler providers can no longer be added via `addProviders` / `withProviders`.
  Use the new method `configureCompiler` instead.
- Platform directives / pipes need to be provided via
  `configureModule` and can no longer be provided via the
  `PLATFORM_PIPES` / `PLATFORM_DIRECTIVES` tokens.
- `setBaseTestProviders()` was renamed into `initTestEnvironment` and 
  now takes a `PlatformRef` and a factory for a
  `Compiler`.
- E.g. for the browser platform:
  
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS} from ‘@angular/platform-browser-dynamic/testing’;
  
  setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);   
  ```
  AFTER:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {browserTestCompiler, browserDynamicTestPlatform,
      BrowserDynamicTestModule} from ‘@angular/platform-browser-dynamic/testing’;
  
  initTestEnvironment(
      browserTestCompiler,
      browserDynamicTestPlatform(),
      BrowserDynamicTestModule);
  ```
- E.g. for the server platform:
  
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS} from ‘@angular/platform-server/testing/server’;
  
  setBaseTestProviders(TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS);   
  ```
  AFTER:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {serverTestCompiler, serverTestPlatform,
      ServerTestModule} from ‘@angular/platform-browser-dynamic/testing’;
  
  initTestEnvironment(
      serverTestCompiler,
      serverTestPlatform(),
      ServerTestModule);
  ```
Related to #9726
Closes #9846
											 
										 
										
											2016-07-04 09:37:30 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ) ;  
						 
					
						
							
								
									
										
										
										
											2016-05-26 14:35:27 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								describe ( 'TemplateParser' ,  ( )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  beforeEach ( ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    TestBed . configureCompiler ( { providers :  [ TEST_COMPILER_PROVIDERS ,  MOCK_SCHEMA_REGISTRY ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-26 14:35:27 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  configureCompiler ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  commonBeforeEach ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-26 14:35:27 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  describe ( 'parse' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    describe ( 'nodes without bindings' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should parse text nodes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( 'a' ,  [ ] ) ) ) . toEqual ( [ [ TextAst ,  'a' ] ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-26 14:35:27 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should parse elements with attributes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div a=b>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ AttrAst ,  'a' ,  'b' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-26 14:35:27 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should parse ngContent' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  parsed  =  parse ( '<ng-content select="a"></ng-content>' ,  [ ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parsed ) ) . toEqual ( [ [ NgContentAst ] ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-10 16:54:32 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should parse ngContent when it contains WS only' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  parsed  =  parse ( '<ng-content select="a">    \n   </ng-content>' ,  [ ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parsed ) ) . toEqual ( [ [ NgContentAst ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-19 10:51:16 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should parse ngContent regardless the namespace' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  parsed  =  parse ( '<svg><ng-content></ng-content></svg>' ,  [ ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parsed ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ ElementAst ,  ':svg:svg' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ NgContentAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should parse bound text nodes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parse ( '{{a}}' ,  [ ] ) ) ) . toEqual ( [ [ BoundTextAst ,  '{{ a }}' ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should parse with custom interpolation config' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       inject ( [ TemplateParser ] ,  ( parser : TemplateParser )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         const  component  =  CompileDirectiveMetadata . create ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           selector :  'test' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'Test' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           isComponent : true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           template : new  CompileTemplateMetadata ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             interpolation :  [ '{%' ,  '%}' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             isInline : false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             animations :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             template : null , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             templateUrl : null , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             htmlAst : null , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             ngContentSelectors :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             externalStylesheets :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             styleUrls :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             styles :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             encapsulation : null , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             preserveWhitespaces : preserveWhitespacesDefault ( null ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           isHost : false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           exportAs : null , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           changeDetection : null , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           inputs :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           outputs :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           host :  { } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           providers :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           viewProviders :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           queries :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           guards :  { } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           viewQueries :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           entryComponents :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           componentViewType : null , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           rendererType : null , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           componentFactory : null 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								         } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         expect ( humanizeTplAst ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    parser . parse ( component ,  '{%a%}' ,  [ ] ,  [ ] ,  [ ] ,  'TestComp' ,  true ) . template , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { start :  '{%' ,  end :  '%}' } ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             . toEqual ( [ [ BoundTextAst ,  '{% a %}' ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       } ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    describe ( 'bound properties' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should parse mixed case bound properties' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [someProp]="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Property ,  'someProp' ,  'v' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-12 07:58:06 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse dash case bound properties' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [some-prop]="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Property ,  'some-prop' ,  'v' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse dotted name bound properties' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [dot.name]="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Property ,  'dot.name' ,  'v' ,  null ] 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-09 10:47:10 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should normalize property names via the element schema' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [mappedAttr]="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Property ,  'mappedProp' ,  'v' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 15:56:25 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse mixed case bound attributes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [attr.someAttr]="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Attribute ,  'someAttr' ,  'v' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 15:56:25 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse mixed case bound attributes with dot in the attribute name' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [attr.someAttr.someAttrSuffix]="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            BoundElementPropertyAst ,  PropertyBindingType . Attribute ,  'someAttr.someAttrSuffix' ,  'v' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            null 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-22 09:45:43 +07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse and dash case bound classes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [class.some-class]="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Class ,  'some-class' ,  'v' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-27 16:29:02 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse mixed case bound classes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [class.someClass]="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Class ,  'someClass' ,  'v' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse mixed case bound styles' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [style.someStyle]="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Style ,  'someStyle' ,  'v' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      describe ( 'errors' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        it ( 'should throw error when binding to an unknown property' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          expect ( ( )  = >  parse ( '<my-component [invalidProp]="bar"></my-component>' ,  [ ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-29 20:16:38 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Can 't bind to ' invalidProp ' since it isn' t  a  known  property  of  'my-component' .  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								1 .  If  'my-component'  is  an  Angular  component  and  it  has  'invalidProp'  input ,  then  verify  that  it  is  part  of  this  module .  
						 
					
						
							
								
									
										
										
										
											2017-02-09 12:29:14 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								2 .  If  'my-component'  is  a  Web  Component  then  add  'CUSTOM_ELEMENTS_SCHEMA'  to  the  '@NgModule.schemas'  of  this  component  to  suppress  this  message .  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								3 .  To  allow  any  property  add  'NO_ERRORS_SCHEMA'  to  the  '@NgModule.schemas'  of  this  component .  ( "<my-component [ERROR ->][invalidProp]=" bar "></my-component>" ) :  TestComp @0 : 14 ` );
  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-23 10:52:40 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        it ( 'should throw error when binding to an unknown property of ng-container' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          expect ( ( )  = >  parse ( '<ng-container [invalidProp]="bar"></ng-container>' ,  [ ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              . toThrowError ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                  ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-09 21:22:44 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Can 't bind to ' invalidProp ' since it isn' t  a  known  property  of  'ng-container' .  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								1 .  If  'invalidProp'  is  an  Angular  directive ,  then  add  'CommonModule'  to  the  '@NgModule.imports'  of  this  component .  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								2 .  To  allow  any  property  add  'NO_ERRORS_SCHEMA'  to  the  '@NgModule.schemas'  of  this  component . `  +
  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                  `  ("<ng-container [ERROR ->][invalidProp]="bar"></ng-container>"): TestComp@0:14 ` ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-09 21:22:44 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        it ( 'should throw error when binding to an unknown element w/o bindings' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          expect ( ( )  = >  parse ( '<unknown></unknown>' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-23 10:52:40 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								'unknown'  is  not  a  known  element :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								1 .  If  'unknown'  is  an  Angular  component ,  then  verify  that  it  is  part  of  this  module .  
						 
					
						
							
								
									
										
										
										
											2017-02-09 12:29:14 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								2 .  To  allow  any  element  add  'NO_ERRORS_SCHEMA'  to  the  '@NgModule.schemas'  of  this  component .  ( "[ERROR ->]<unknown></unknown>" ) :  TestComp @0 : 0 ` );
  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-23 10:52:40 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        it ( 'should throw error when binding to an unknown custom element w/o bindings' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          expect ( ( )  = >  parse ( '<un-known></un-known>' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-23 10:52:40 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								'un-known'  is  not  a  known  element :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								1 .  If  'un-known'  is  an  Angular  component ,  then  verify  that  it  is  part  of  this  module .  
						 
					
						
							
								
									
										
										
										
											2017-02-09 12:29:14 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								2 .  If  'un-known'  is  a  Web  Component  then  add  'CUSTOM_ELEMENTS_SCHEMA'  to  the  '@NgModule.schemas'  of  this  component  to  suppress  this  message .  ( "[ERROR ->]<un-known></un-known>" ) :  TestComp @0 : 0 ` );
  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-28 02:10:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        it ( 'should throw error when binding to an invalid property' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          expect ( ( )  = >  parse ( '<my-component [onEvent]="bar"></my-component>' ,  [ ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-28 02:10:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Binding  to  property  'onEvent'  is  disallowed  for  security  reasons  ( "<my-component [ERROR ->][onEvent]=" bar "></my-component>" ) :  TestComp @0 : 14 ` );
  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-28 02:10:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        it ( 'should throw error when binding to an invalid attribute' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          expect ( ( )  = >  parse ( '<my-component [attr.onEvent]="bar"></my-component>' ,  [ ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-28 02:10:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Binding  to  attribute  'onEvent'  is  disallowed  for  security  reasons  ( "<my-component [ERROR ->][attr.onEvent]=" bar "></my-component>" ) :  TestComp @0 : 14 ` );
  
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse bound properties via [...] and not report them as attributes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [prop]="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Property ,  'prop' ,  'v' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse bound properties via bind- and not report them as attributes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div bind-prop="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Property ,  'prop' ,  'v' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report missing property names in bind- syntax' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div bind-></div>' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-28 18:02:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Property  name  is  missing  in  binding  ( "<div [ERROR ->]bind-></div>" ) :  TestComp @0 : 5 ` );
  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-28 18:02:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse bound properties via {{...}} and not report them as attributes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div prop="{{v}}">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Property ,  'prop' ,  '{{ v }}' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-27 16:29:02 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse bound properties via bind-animate- and not report them as attributes' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           expect ( humanizeTplAst ( parse ( '<div bind-animate-someAnimation="value2">' ,  [ ] ,  [ ] ,  [ ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   BoundElementPropertyAst ,  PropertyBindingType . Animation ,  'someAnimation' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   'value2' ,  null 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-28 18:02:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should throw an error when parsing detects non-bound properties via @ that contain a value' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           expect ( ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             parse ( '<div @someAnimation="value2">' ,  [ ] ,  [ ] ,  [ ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               . toThrowError ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   /Assigning animation triggers via @prop="exp" attributes with an expression is invalid. Use property bindings \(e.g. \[@prop\]="exp"\) or use an attribute without a value \(e.g. @prop\) instead. \("<div \[ERROR ->\]@someAnimation="value2">"\): TestComp@0:5/ ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-26 19:29:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report missing animation trigger in @ syntax' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div @></div>' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Animation  trigger  is  missing  ( "<div [ERROR ->]@></div>" ) :  TestComp @0 : 5 ` );
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-26 19:29:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should not issue a warning when host attributes contain a valid property-bound animation trigger' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           const  animationEntries  =  [ 'prop' ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          template : compileTemplateMetadata ( { animations : animationEntries } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          type :  createTypeMeta ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            reference :  { filePath : someModuleUrl ,  name :  'DirA' } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          host :  { '[@prop]' :  'expr' } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           humanizeTplAst ( parse ( '<div></div>' ,  [ dirA ] ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           expect ( console . warnings . length ) . toEqual ( 0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-27 16:29:02 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should throw descriptive error when a host binding is not a string expression' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  'broken' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       host :  { '[class.foo]' :  null ! } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        expect ( ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          parse ( '<broken></broken>' ,  [ dirA ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toThrowError ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ` Template parse errors: \ nValue of the host property binding "class.foo" needs to be a string representing an expression but got "null" (object) ("[ERROR ->]<broken></broken>"): TestComp@0:0, Directive DirA ` ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 17:27:38 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should throw descriptive error when a host event is not a string expression' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  'broken' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       host :  { '(click)' :  null ! } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 17:27:38 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        expect ( ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          parse ( '<broken></broken>' ,  [ dirA ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toThrowError ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ` Template parse errors: \ nValue of the host listener "click" needs to be a string representing an expression but got "null" (object) ("[ERROR ->]<broken></broken>"): TestComp@0:0, Directive DirA ` ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 17:27:38 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should not issue a warning when an animation property is bound without an expression' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           humanizeTplAst ( parse ( '<div @someAnimation>' ,  [ ] ,  [ ] ,  [ ] ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           expect ( console . warnings . length ) . toEqual ( 0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 17:27:38 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse bound properties via [@] and not report them as attributes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [@someAnimation]="value2">' ,  [ ] ,  [ ] ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Animation ,  'someAnimation' ,  'value2' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 17:27:38 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should support * directives' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div *ngIf>' ,  [ ngIf ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ DirectiveAst ,  ngIf ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundDirectivePropertyAst ,  'ngIf' ,  'null' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-27 16:29:02 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should support <ng-template>' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<ng-template>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should treat <template> as a regular tag' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<template>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'template' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-18 10:33:23 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should not special case the template attribute' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<p template="ngFor">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'p' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ AttrAst ,  'template' ,  'ngFor' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-27 16:29:02 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( 'events' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should parse bound events with a target' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div (window:event)="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundEventAst ,  'event' ,  'window' ,  'v' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report an error on empty expression' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div (event)="">' ,  [ ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toThrowError ( /Empty expressions are not allowed/ ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-06 14:13:44 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div (event)="  ">' ,  [ ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toThrowError ( /Empty expressions are not allowed/ ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-06 14:13:44 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse bound events via (...) and not report them as attributes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div (event)="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ BoundEventAst ,  'event' ,  null ,  'v' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-28 18:02:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse event names case sensitive' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div (some-event)="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ BoundEventAst ,  'some-event' ,  null ,  'v' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div (someEvent)="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ BoundEventAst ,  'someEvent' ,  null ,  'v' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-18 10:33:23 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse bound events via on- and not report them as attributes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div on-event="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ BoundEventAst ,  'event' ,  null ,  'v' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-28 02:10:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report missing event names in on- syntax' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div on-></div>' ,  [ ] ) ) . toThrowError ( /Event name is missing in binding/ ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-18 10:33:23 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should allow events on explicit embedded templates that are emitted by a directive' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          selector :  'ng-template' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          outputs :  [ 'e' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           expect ( humanizeTplAst ( parse ( '<ng-template (e)="f"></ng-template>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ BoundEventAst ,  'e' ,  null ,  'f' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ DirectiveAst ,  dirA ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( 'bindon' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should parse bound events and properties via [(...)] and not report them as attributes' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           expect ( humanizeTplAst ( parse ( '<div [(prop)]="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ BoundElementPropertyAst ,  PropertyBindingType . Property ,  'prop' ,  'v' ,  null ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ BoundEventAst ,  'propChange' ,  null ,  'v = $event' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-27 15:23:49 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse bound events and properties via bindon- and not report them as attributes' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           expect ( humanizeTplAst ( parse ( '<div bindon-prop="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ BoundElementPropertyAst ,  PropertyBindingType . Property ,  'prop' ,  'v' ,  null ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ BoundEventAst ,  'propChange' ,  null ,  'v = $event' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-27 15:23:49 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report missing property names in bindon- syntax' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div bindon-></div>' ,  [ ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toThrowError ( /Property name is missing in binding/ ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-23 16:02:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( 'directives' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should order directives by the directives array in the View and match them only once' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          selector :  '[a]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           const  dirB  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          selector :  '[b]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirB' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           const  dirC  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          selector :  '[c]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                          type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirC' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           expect ( humanizeTplAst ( parse ( '<div a c b a b>' ,  [ dirA ,  dirB ,  dirC ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ ElementAst ,  'div' ] ,  [ AttrAst ,  'a' ,  '' ] ,  [ AttrAst ,  'c' ,  '' ] ,  [ AttrAst ,  'b' ,  '' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ AttrAst ,  'a' ,  '' ] ,  [ AttrAst ,  'b' ,  '' ] ,  [ DirectiveAst ,  dirA ] ,  [ DirectiveAst ,  dirB ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ DirectiveAst ,  dirC ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-01-09 13:16:37 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse directive dotted properties' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  '[dot.name]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       inputs :  [ 'localName: dot.name' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-18 10:33:23 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [dot.name]="expr"></div>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ DirectiveAst ,  dirA ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundDirectivePropertyAst ,  'localName' ,  'expr' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-06 14:06:47 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should locate directives in property bindings' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  '[a=b]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirB  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  '[b]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirB' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [a]="b">' ,  [ dirA ,  dirB ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Property ,  'a' ,  'b' ,  null ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ DirectiveAst ,  dirA ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-08 09:01:15 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should locate directives in inline templates' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirTemplate  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              selector :  'ng-template' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'onTemplate' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div *ngIf="cond">' ,  [ ngIf ,  dirTemplate ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ DirectiveAst ,  ngIf ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundDirectivePropertyAst ,  'ngIf' ,  'cond' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ DirectiveAst ,  dirTemplate ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-25 19:52:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should locate directives in event bindings' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  '[a]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirB' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-25 19:52:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div (a)="b">' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ BoundEventAst ,  'a' ,  null ,  'b' ] ,  [ DirectiveAst ,  dirA ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse directive host properties' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       host :  { '[a]' :  'expr' } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div></div>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ DirectiveAst ,  dirA ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundElementPropertyAst ,  PropertyBindingType . Property ,  'a' ,  'expr' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse directive host listeners' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       host :  { '(a)' :  'expr' } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div></div>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ DirectiveAst ,  dirA ] ,  [ BoundEventAst ,  'a' ,  null ,  'expr' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse directive properties' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       inputs :  [ 'aProp' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [aProp]="expr"></div>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ DirectiveAst ,  dirA ] ,  [ BoundDirectivePropertyAst ,  'aProp' ,  'expr' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-26 13:22:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse renamed directive properties' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       inputs :  [ 'b:a' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div [a]="expr"></div>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ DirectiveAst ,  dirA ] ,  [ BoundDirectivePropertyAst ,  'b' ,  'expr' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-28 02:10:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse literal directive properties' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       inputs :  [ 'a' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div a="literal"></div>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ AttrAst ,  'a' ,  'literal' ] ,  [ DirectiveAst ,  dirA ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundDirectivePropertyAst ,  'a' ,  '"literal"' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should favor explicit bound properties over literal properties' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       inputs :  [ 'a' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div a="literal" [a]="\'literal2\'"></div>' ,  [ dirA ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ ElementAst ,  'div' ] ,  [ AttrAst ,  'a' ,  'literal' ] ,  [ DirectiveAst ,  dirA ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ BoundDirectivePropertyAst ,  'a' ,  '"literal2"' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should support optional directive properties' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       inputs :  [ 'a' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div></div>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ DirectiveAst ,  dirA ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( 'providers' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      let  nextProviderId : number ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      function  createToken ( value : string ) :  CompileTokenMetadata  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        let  token : CompileTokenMetadata ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( value . startsWith ( 'type:' ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          const  name  =  value . substring ( 5 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          token  =  { identifier : createTypeMeta ( { reference :  < any > name } ) } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          token  =  { value : value } ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  token ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      function  createDep ( value : string ) :  CompileDiDependencyMetadata  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        let  isOptional  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( value . startsWith ( 'optional:' ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          isOptional  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          value  =  value . substring ( 9 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        let  isSelf  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( value . startsWith ( 'self:' ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          isSelf  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          value  =  value . substring ( 5 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        let  isHost  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( value . startsWith ( 'host:' ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          isHost  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          value  =  value . substring ( 5 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  { token : createToken ( value ) ,  isOptional : isOptional ,  isSelf : isSelf ,  isHost : isHost } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-29 17:07:28 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      function  createProvider ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          token : string ,  { multi  =  false ,  deps  =  [ ] } :  { multi? : boolean ,  deps? : string [ ] }  =  { } ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          CompileProviderMetadata  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  compileToken  =  createToken ( token ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          token : compileToken , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          multi : multi , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          useClass : createTypeMeta ( { reference : tokenReference ( compileToken ) } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          deps : deps.map ( createDep ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          useExisting : undefined , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          useFactory : undefined , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          useValue : undefined 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      function  createDir ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          selector : string , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          { providers  =  undefined ,  viewProviders  =  undefined ,  deps  =  [ ] ,  queries  =  [ ] } :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            providers? : CompileProviderMetadata [ ] | undefined , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            viewProviders? : CompileProviderMetadata [ ] | undefined , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            deps? : string [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            queries? : string [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          }  =  { } ) :  CompileDirectiveSummary  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  isComponent  =  ! selector . startsWith ( '[' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 selector : selector , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 type :  createTypeMeta ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   reference :  < any > selector , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   diDeps : deps.map ( createDep ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 isComponent : isComponent , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 template : compileTemplateMetadata ( { ngContentSelectors :  [ ] } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 providers : providers , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 viewProviders : viewProviders , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 queries : queries.map ( ( value )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     selectors :  [ createToken ( value ) ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     descendants : false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     first : false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     propertyName :  'test' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     read : undefined ! 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 15:36:02 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      beforeEach ( ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        nextProviderId  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should provide a component' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  comp  =  createDir ( 'my-comp' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<my-comp>' ,  [ comp ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providerType ) . toBe ( ProviderAstType . Component ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers [ 0 ] . useClass ) . toBe ( comp . type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should provide a directive' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<div dirA>' ,  [ dirA ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providerType ) . toBe ( ProviderAstType . Directive ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers [ 0 ] . useClass ) . toBe ( dirA . type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should use the public providers of a directive' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider  =  createProvider ( 'service' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { providers :  [ provider ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<div dirA>' ,  [ dirA ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 2 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providerType ) . toBe ( ProviderAstType . PublicService ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers ) . toEqual ( [ provider ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should use the private providers of a component' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider  =  createProvider ( 'service' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  comp  =  createDir ( 'my-comp' ,  { viewProviders :  [ provider ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<my-comp>' ,  [ comp ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 2 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providerType ) . toBe ( ProviderAstType . PrivateService ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers ) . toEqual ( [ provider ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should support multi providers' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider0  =  createProvider ( 'service0' ,  { multi : true } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider1  =  createProvider ( 'service1' ,  { multi : true } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider2  =  createProvider ( 'service0' ,  { multi : true } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { providers :  [ provider0 ,  provider1 ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirB  =  createDir ( '[dirB]' ,  { providers :  [ provider2 ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<div dirA dirB>' ,  [ dirA ,  dirB ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 4 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers ) . toEqual ( [ provider0 ,  provider2 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 1 ] . providers ) . toEqual ( [ provider1 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should overwrite non multi providers' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider1  =  createProvider ( 'service0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider2  =  createProvider ( 'service1' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider3  =  createProvider ( 'service0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { providers :  [ provider1 ,  provider2 ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirB  =  createDir ( '[dirB]' ,  { providers :  [ provider3 ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<div dirA dirB>' ,  [ dirA ,  dirB ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 4 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers ) . toEqual ( [ provider3 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 1 ] . providers ) . toEqual ( [ provider2 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should overwrite component providers by directive providers' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  compProvider  =  createProvider ( 'service0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirProvider  =  createProvider ( 'service0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  comp  =  createDir ( 'my-comp' ,  { providers :  [ compProvider ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { providers :  [ dirProvider ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<my-comp dirA>' ,  [ dirA ,  comp ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 3 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers ) . toEqual ( [ dirProvider ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should overwrite view providers by directive providers' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  viewProvider  =  createProvider ( 'service0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirProvider  =  createProvider ( 'service0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  comp  =  createDir ( 'my-comp' ,  { viewProviders :  [ viewProvider ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { providers :  [ dirProvider ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<my-comp dirA>' ,  [ dirA ,  comp ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 3 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers ) . toEqual ( [ dirProvider ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should overwrite directives by providers' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirProvider  =  createProvider ( 'type:my-comp' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  comp  =  createDir ( 'my-comp' ,  { providers :  [ dirProvider ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<my-comp>' ,  [ comp ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers ) . toEqual ( [ dirProvider ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'if mixing multi and non multi providers' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider0  =  createProvider ( 'service0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider1  =  createProvider ( 'service0' ,  { multi : true } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { providers :  [ provider0 ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirB  =  createDir ( '[dirB]' ,  { providers :  [ provider1 ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div dirA dirB>' ,  [ dirA ,  dirB ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toThrowError ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ` Template parse errors: \ n `  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ` Mixing multi and non multi provider is not possible for token service0 ("[ERROR ->]<div dirA dirB>"): TestComp@0:0 ` ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should sort providers by their DI order, lazy providers first' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider0  =  createProvider ( 'service0' ,  { deps :  [ 'type:[dir2]' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider1  =  createProvider ( 'service1' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dir2  =  createDir ( '[dir2]' ,  { deps :  [ 'service1' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  comp  =  createDir ( 'my-comp' ,  { providers :  [ provider0 ,  provider1 ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<my-comp dir2>' ,  [ comp ,  dir2 ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 4 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 1 ] . providers [ 0 ] . useClass ) . toEqual ( comp . type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 2 ] . providers ) . toEqual ( [ provider1 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 3 ] . providers [ 0 ] . useClass ) . toEqual ( dir2 . type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers ) . toEqual ( [ provider0 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should sort directives by their DI order' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dir0  =  createDir ( '[dir0]' ,  { deps :  [ 'type:my-comp' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dir1  =  createDir ( '[dir1]' ,  { deps :  [ 'type:[dir0]' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dir2  =  createDir ( '[dir2]' ,  { deps :  [ 'type:[dir1]' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  comp  =  createDir ( 'my-comp' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            < ElementAst > parse ( '<my-comp dir2 dir0 dir1>' ,  [ comp ,  dir2 ,  dir0 ,  dir1 ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 4 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . directives [ 0 ] . directive ) . toBe ( comp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . directives [ 1 ] . directive ) . toBe ( dir0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . directives [ 2 ] . directive ) . toBe ( dir1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . directives [ 3 ] . directive ) . toBe ( dir2 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should mark directives and dependencies of directives as eager' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider0  =  createProvider ( 'service0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider1  =  createProvider ( 'service1' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { providers :  [ provider0 ,  provider1 ] ,  deps :  [ 'service0' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<div dirA>' ,  [ dirA ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 3 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 1 ] . providers ) . toEqual ( [ provider0 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 1 ] . eager ) . toBe ( true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 2 ] . providers [ 0 ] . useClass ) . toEqual ( dirA . type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 2 ] . eager ) . toBe ( true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers ) . toEqual ( [ provider1 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . eager ) . toBe ( false ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should mark dependencies on parent elements as eager' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider0  =  createProvider ( 'service0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider1  =  createProvider ( 'service1' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { providers :  [ provider0 ,  provider1 ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirB  =  createDir ( '[dirB]' ,  { deps :  [ 'service0' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            < ElementAst > parse ( '<div dirA><div dirB></div></div>' ,  [ dirA ,  dirB ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 3 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 1 ] . providers [ 0 ] . useClass ) . toEqual ( dirA . type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 1 ] . eager ) . toBe ( true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 2 ] . providers ) . toEqual ( [ provider0 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 2 ] . eager ) . toBe ( true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers ) . toEqual ( [ provider1 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . eager ) . toBe ( false ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should mark queried providers as eager' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider0  =  createProvider ( 'service0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider1  =  createProvider ( 'service1' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            createDir ( '[dirA]' ,  { providers :  [ provider0 ,  provider1 ] ,  queries :  [ 'service0' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<div dirA></div>' ,  [ dirA ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 3 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 1 ] . providers [ 0 ] . useClass ) . toEqual ( dirA . type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 1 ] . eager ) . toBe ( true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 2 ] . providers ) . toEqual ( [ provider0 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 2 ] . eager ) . toBe ( true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers ) . toEqual ( [ provider1 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . eager ) . toBe ( false ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should not mark dependencies across embedded views as eager' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  provider0  =  createProvider ( 'service0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { providers :  [ provider0 ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirB  =  createDir ( '[dirB]' ,  { deps :  [ 'service0' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            < ElementAst > parse ( '<div dirA><div *ngIf dirB></div></div>' ,  [ dirA ,  dirB ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers . length ) . toBe ( 2 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 1 ] . providers [ 0 ] . useClass ) . toEqual ( dirA . type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 1 ] . eager ) . toBe ( true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers ) . toEqual ( [ provider0 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . eager ) . toBe ( false ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should report missing @Self() deps as errors' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { deps :  [ 'self:provider0' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div dirA></div>' ,  [ dirA ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toThrowError ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                'Template parse errors:\nNo provider for provider0 ("[ERROR ->]<div dirA></div>"): TestComp@0:0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-27 16:29:02 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should change missing @Self() that are optional to nulls' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { deps :  [ 'optional:self:provider0' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<div dirA></div>' ,  [ dirA ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers [ 0 ] . deps ! [ 0 ] . isValue ) . toBe ( true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers [ 0 ] . deps ! [ 0 ] . value ) . toBe ( null ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-03 14:20:00 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report missing @Host() deps as errors' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { deps :  [ 'host:provider0' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div dirA></div>' ,  [ dirA ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toThrowError ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                'Template parse errors:\nNo provider for provider0 ("[ERROR ->]<div dirA></div>"): TestComp@0:0' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-22 17:43:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should change missing @Host() that are optional to nulls' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  createDir ( '[dirA]' ,  { deps :  [ 'optional:host:provider0' ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  elAst : ElementAst  =  < ElementAst > parse ( '<div dirA></div>' ,  [ dirA ] ) [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers [ 0 ] . deps ! [ 0 ] . isValue ) . toBe ( true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( elAst . providers [ 0 ] . providers [ 0 ] . deps ! [ 0 ] . value ) . toBe ( null ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-22 17:43:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( 'references' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should parse references via #... and not report them as attributes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div #a>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ ReferenceAst ,  'a' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-22 17:43:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse references via ref-... and not report them as attributes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div ref-a>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ ReferenceAst ,  'a' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-22 17:43:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse camel case references' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div ref-someA>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ ReferenceAst ,  'someA' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-27 16:29:02 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should assign references with empty value to the element' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div #a></div>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ ReferenceAst ,  'a' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-28 02:27:07 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should assign references to directives via exportAs' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  '[a]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       exportAs :  'dirA' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div a #a="dirA"></div>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ AttrAst ,  'a' ,  '' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ReferenceAst ,  'a' ,  createTokenForReference ( dirA . type . reference ) ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ DirectiveAst ,  dirA ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-27 16:29:02 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should assign references to directives via exportAs with multiple names' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  pizzaTestDirective  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              selector :  'pizza-test' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'Pizza' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              exportAs :  'pizza, cheeseSauceBread' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-27 16:29:02 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  template  =  '<pizza-test #food="pizza" #yum="cheeseSauceBread"></pizza-test>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-28 02:10:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( template ,  [ pizzaTestDirective ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'pizza-test' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ReferenceAst ,  'food' ,  createTokenForReference ( pizzaTestDirective . type . reference ) ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ReferenceAst ,  'yum' ,  createTokenForReference ( pizzaTestDirective . type . reference ) ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ DirectiveAst ,  pizzaTestDirective ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-15 16:34:47 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report references with values that don\'t match a directive as errors' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div #a="dirA"></div>' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								There  is  no  directive  with  "exportAs"  set  to  "dirA"  ( "<div [ERROR ->]#a=" dirA "></div>" ) :  TestComp @0 : 5 ` );
  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-18 10:33:23 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report invalid reference names' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div #a-b></div>' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								"-"  is  not  allowed  in  reference  names  ( "<div [ERROR ->]#a-b></div>" ) :  TestComp @0 : 5 ` );
  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-18 10:33:23 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report missing reference names' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div #></div>' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-28 18:02:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Reference  does  not  have  a  name  ( "<div [ERROR ->]#></div>" ) :  TestComp @0 : 5 ` );
  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-28 18:02:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report variables as errors' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div let-a></div>' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-04 14:06:38 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								"let-"  is  only  supported  on  ng - template  elements .  ( "<div [ERROR ->]let-a></div>" ) :  TestComp @0 : 5 ` );
  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-18 10:33:23 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report missing variable names' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<ng-template let-></ng-template>' ,  [ ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-28 18:02:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Variable  does  not  have  a  name  ( "<ng-template [ERROR ->]let-></ng-template>" ) :  TestComp @0 : 13 ` );
  
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-28 18:02:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report duplicate reference names' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div #a></div><div #a></div>' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Reference  "#a"  is  defined  several  times  ( "<div #a></div><div [ERROR ->]#a></div>" ) :  TestComp @0 : 19 ` );
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 15:56:25 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should report duplicate reference names when using multiple exportAs names' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  pizzaDirective  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              selector :  '[dessert-pizza]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'Pizza' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              exportAs :  'dessertPizza, chocolate' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 15:56:25 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  chocolateDirective  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              selector :  '[chocolate]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'Chocolate' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              exportAs :  'chocolate' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 15:56:25 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  template  =  '<div dessert-pizza chocolate #snack="chocolate"></div>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  compileTemplate  =  ( )  = >  parse ( template ,  [ pizzaDirective ,  chocolateDirective ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  duplicateReferenceError  =  'Template parse errors:\n'  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            'Reference "#snack" is defined several times '  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            '("<div dessert-pizza chocolate [ERROR ->]#snack="chocolate"></div>")'  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ': TestComp@0:29' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-25 19:52:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        expect ( compileTemplate ) . toThrowError ( duplicateReferenceError ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 15:56:25 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should not throw error when there is same reference name in different templates' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  parse ( '<div #a><ng-template #a><span>OK</span></ng-template></div>' ,  [ ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . not . toThrowError ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-01-05 17:25:41 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should assign references with empty value to components' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  '[a]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       isComponent : true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       exportAs :  'dirA' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       template : compileTemplateMetadata ( { ngContentSelectors :  [ ] } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div a #a></div>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ AttrAst ,  'a' ,  '' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ReferenceAst ,  'a' ,  createTokenForReference ( dirA . type . reference ) ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ DirectiveAst ,  dirA ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 15:56:25 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should not locate directives in references' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  '[a]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div ref-a>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] ,  [ ReferenceAst ,  'a' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-02 10:35:51 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( 'explicit templates' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      let  reflector : JitReflector ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      beforeEach ( ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        reflector  =  new  JitReflector ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-30 14:59:23 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should create embedded templates for <ng-template> elements' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<ng-template></ng-template>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-30 14:59:23 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should create embedded templates for <ng-template> elements regardless the namespace' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           expect ( humanizeTplAst ( parse ( '<svg><ng-template></ng-template></svg>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ ElementAst ,  ':svg:svg' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-30 14:59:23 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should support references via #...' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<ng-template #a>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ReferenceAst ,  'a' ,  createTokenForExternalReference ( reflector ,  Identifiers . TemplateRef ) ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-30 14:59:23 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should support references via ref-...' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<ng-template ref-a>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ReferenceAst ,  'a' ,  createTokenForExternalReference ( reflector ,  Identifiers . TemplateRef ) ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse variables via let-...' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<ng-template let-a="b">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ VariableAst ,  'a' ,  'b' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should not locate directives in variables' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  '[a]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<ng-template let-a="b"></ng-template>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ VariableAst ,  'a' ,  'b' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( 'inline templates' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should report an error on variables declared with #' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( ( )  = >  humanizeTplAst ( parse ( '<div *ngIf="#a=b">' ,  [ ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toThrowError ( /Parser Error: Unexpected token # at column 1/ ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse variables via let ...' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  targetAst  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ VariableAst ,  'a' ,  'b' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div *ngIf="let a=b">' ,  [ ] ) ) ) . toEqual ( targetAst ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div data-*ngIf="let a=b">' ,  [ ] ) ) ) . toEqual ( targetAst ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should parse variables via as ...' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  targetAst  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ VariableAst ,  'local' ,  'ngIf' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ DirectiveAst ,  ngIf ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundDirectivePropertyAst ,  'ngIf' ,  'expr' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div *ngIf="expr as local">' ,  [ ngIf ] ) ) ) . toEqual ( targetAst ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      describe ( 'directives' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        it ( 'should locate directives in property bindings' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         selector :  '[a=b]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         inputs :  [ 'a' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          const  dirB  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         selector :  '[b]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirB' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          expect ( humanizeTplAst ( parse ( '<div *a="b" b>' ,  [ dirA ,  dirB ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            [ EmbeddedTemplateAst ] ,  [ DirectiveAst ,  dirA ] ,  [ BoundDirectivePropertyAst ,  'a' ,  'b' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            [ ElementAst ,  'div' ] ,  [ AttrAst ,  'b' ,  '' ] ,  [ DirectiveAst ,  dirB ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-28 02:10:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        it ( 'should not locate directives in variables' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         selector :  '[a]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          expect ( humanizeTplAst ( parse ( '<ng-template let-a="b"><div></div></ng-template>' ,  [ dirA ] ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-01-09 13:16:46 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								              . toEqual ( [ 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                [ VariableAst ,  'a' ,  'b' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2017-01-09 13:16:46 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								              ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        it ( 'should not locate directives in references' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         selector :  '[a]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          expect ( humanizeTplAst ( parse ( '<div ref-a>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            [ ElementAst ,  'div' ] ,  [ ReferenceAst ,  'a' ,  null ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should work with *... and use the attribute name as property binding name' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div *ngIf="test">' ,  [ ngIf ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ DirectiveAst ,  ngIf ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundDirectivePropertyAst ,  'ngIf' ,  'test' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        // https://github.com/angular/angular/issues/13800
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div *ngIf="-1">' ,  [ ngIf ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ DirectiveAst ,  ngIf ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-04 01:52:40 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								          [ BoundDirectivePropertyAst ,  'ngIf' ,  '-1' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should work with *... and empty value' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<div *ngIf>' ,  [ ngIf ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ EmbeddedTemplateAst ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ DirectiveAst ,  ngIf ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ BoundDirectivePropertyAst ,  'ngIf' ,  'null' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'div' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  describe ( 'content projection' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    let  compCounter : number ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    beforeEach ( ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      compCounter  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    function  createComp ( selector : string ,  ngContentSelectors : string [ ] ) :  CompileDirectiveSummary  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      return  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               selector : selector , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               isComponent : true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               type :  createTypeMeta ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   { reference :  { filePath : someModuleUrl ,  name :  ` SomeComp ${ compCounter ++ } ` } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               template : compileTemplateMetadata ( { ngContentSelectors : ngContentSelectors } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    function  createDir ( selector : string ) :  CompileDirectiveSummary  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      return  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               selector : selector , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               type :  createTypeMeta ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   { reference :  { filePath : someModuleUrl ,  name :  ` SomeDir ${ compCounter ++ } ` } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( 'project text nodes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should project text nodes with wildcard selector' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeContentProjection ( parse ( '<div>hello</div>' ,  [ createComp ( 'div' ,  [ '*' ] ) ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'div' ,  null ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ '#text(hello)' ,  0 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( 'project elements' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should project elements with wildcard selector' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeContentProjection ( parse ( '<div><span></span></div>' ,  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          createComp ( 'div' ,  [ '*' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ) ) . toEqual ( [ [ 'div' ,  null ] ,  [ 'span' ,  0 ] ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should project elements with css selector' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeContentProjection ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   parse ( '<div><a x></a><b></b></div>' ,  [ createComp ( 'div' ,  [ 'a[x]' ] ) ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'div' ,  null ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'a' ,  0 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'b' ,  null ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( 'embedded templates' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should project embedded templates with wildcard selector' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeContentProjection ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   parse ( '<div><ng-template></ng-template></div>' ,  [ createComp ( 'div' ,  [ '*' ] ) ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'div' ,  null ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'template' ,  0 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should project embedded templates with css selector' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeContentProjection ( parse ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   '<div><ng-template x></ng-template><ng-template></ng-template></div>' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   [ createComp ( 'div' ,  [ 'ng-template[x]' ] ) ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'div' ,  null ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'template' ,  0 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'template' ,  null ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( 'ng-content' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should project ng-content with wildcard selector' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeContentProjection ( parse ( '<div><ng-content></ng-content></div>' ,  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          createComp ( 'div' ,  [ '*' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ) ) . toEqual ( [ [ 'div' ,  null ] ,  [ 'ng-content' ,  0 ] ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should project ng-content with css selector' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeContentProjection ( parse ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   '<div><ng-content x></ng-content><ng-content></ng-content></div>' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   [ createComp ( 'div' ,  [ 'ng-content[x]' ] ) ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toEqual ( [ [ 'div' ,  null ] ,  [ 'ng-content' ,  0 ] ,  [ 'ng-content' ,  null ] ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should project into the first matching ng-content' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeContentProjection ( parse ( '<div>hello<b></b><a></a></div>' ,  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        createComp ( 'div' ,  [ 'a' ,  'b' ,  '*' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ) ) . toEqual ( [ [ 'div' ,  null ] ,  [ '#text(hello)' ,  2 ] ,  [ 'b' ,  1 ] ,  [ 'a' ,  0 ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should project into wildcard ng-content last' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeContentProjection ( parse ( '<div>hello<a></a></div>' ,  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        createComp ( 'div' ,  [ '*' ,  'a' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ) ) . toEqual ( [ [ 'div' ,  null ] ,  [ '#text(hello)' ,  0 ] ,  [ 'a' ,  1 ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should only project direct child nodes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeContentProjection ( parse ( '<div><span><a></a></span><a></a></div>' ,  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        createComp ( 'div' ,  [ 'a' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ) ) . toEqual ( [ [ 'div' ,  null ] ,  [ 'span' ,  null ] ,  [ 'a' ,  null ] ,  [ 'a' ,  0 ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should project nodes of nested components' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeContentProjection ( parse ( '<a><b>hello</b></a>' ,  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        createComp ( 'a' ,  [ '*' ] ) ,  createComp ( 'b' ,  [ '*' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ) ) . toEqual ( [ [ 'a' ,  null ] ,  [ 'b' ,  0 ] ,  [ '#text(hello)' ,  0 ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should project children of components with ngNonBindable' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeContentProjection ( parse ( '<div ngNonBindable>{{hello}}<span></span></div>' ,  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        createComp ( 'div' ,  [ '*' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ) ) . toEqual ( [ [ 'div' ,  null ] ,  [ '#text({{hello}})' ,  0 ] ,  [ 'span' ,  0 ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should match the element when there is an inline template' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeContentProjection ( parse ( '<div><b *ngIf="cond"></b></div>' ,  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        createComp ( 'div' ,  [ 'a' ,  'b' ] ) ,  ngIf 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ) ) . toEqual ( [ [ 'div' ,  null ] ,  [ 'template' ,  1 ] ,  [ 'b' ,  null ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( 'ngProjectAs' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should override elements' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeContentProjection ( parse ( '<div><a ngProjectAs="b"></a></div>' ,  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          createComp ( 'div' ,  [ 'a' ,  'b' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ) ) . toEqual ( [ [ 'div' ,  null ] ,  [ 'a' ,  1 ] ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should override <ng-content>' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeContentProjection ( parse ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   '<div><ng-content ngProjectAs="b"></ng-content></div>' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   [ createComp ( 'div' ,  [ 'ng-content' ,  'b' ] ) ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toEqual ( [ [ 'div' ,  null ] ,  [ 'ng-content' ,  1 ] ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should override <ng-template>' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeContentProjection ( parse ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   '<div><ng-template ngProjectAs="b"></ng-template></div>' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   [ createComp ( 'div' ,  [ 'template' ,  'b' ] ) ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'div' ,  null ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'template' ,  1 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should override inline templates' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeContentProjection ( parse ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   '<div><a *ngIf="cond" ngProjectAs="b"></a></div>' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   [ createComp ( 'div' ,  [ 'a' ,  'b' ] ) ,  ngIf ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'div' ,  null ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'template' ,  1 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ 'a' ,  null ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should support other directives before the component' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeContentProjection ( parse ( '<div>hello</div>' ,  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        createDir ( 'div' ) ,  createComp ( 'div' ,  [ '*' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ) ) . toEqual ( [ [ 'div' ,  null ] ,  [ '#text(hello)' ,  0 ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  describe ( 'splitClasses' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should keep an empty class' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( splitClasses ( 'a' ) ) . toEqual ( [ 'a' ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should split 2 classes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( splitClasses ( 'a b' ) ) . toEqual ( [ 'a' ,  'b' ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should trim classes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( splitClasses ( ' a  b ' ) ) . toEqual ( [ 'a' ,  'b' ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  describe ( 'error cases' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should report when ng-content has non WS content' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( ( )  = >  parse ( '<ng-content>content</ng-content>' ,  [ ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          . toThrowError ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              ` Template parse errors: \ n `  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              ` <ng-content> element cannot have content. ("[ERROR ->]<ng-content>content</ng-content>"): TestComp@0:0 ` ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should treat *attr on a template element as valid' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( ( )  = >  parse ( '<ng-template *ngIf>' ,  [ ] ) ) . not . toThrowError ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should report when multiple *attrs are used on the same element' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( ( )  = >  parse ( '<div *ngIf *ngFor>' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Can ' t  have  multiple  template  bindings  on  one  element .  Use  only  one  attribute  prefixed  with  *  ( "<div *ngIf [ERROR ->]*ngFor>" ) :  TestComp @0 : 11 ` );
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should report invalid property names' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( ( )  = >  parse ( '<div [invalidProp]></div>' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Can 't bind to ' invalidProp ' since it isn' t  a  known  property  of  'div' .  ( "<div [ERROR ->][invalidProp]></div>" ) :  TestComp @0 : 5 ` );
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should report invalid host property names' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     host :  { '[invalidProp]' :  'someProp' } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( ( )  = >  parse ( '<div></div>' ,  [ dirA ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Can 't bind to ' invalidProp ' since it isn' t  a  known  property  of  'div' .  ( "[ERROR ->]<div></div>" ) :  TestComp @0 : 0 ,  Directive  DirA ` );
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should report errors in expressions' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( ( )  = >  parse ( '<div [prop]="a b"></div>' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Parser  Error :  Unexpected  token  'b'  at  column  3  in  [ a  b ]  in  TestComp @0 : 13  ( "<div [prop]=" [ ERROR  - > ] a  b "></div>" ) :  TestComp @0 : 13 ` );
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should not throw on invalid property names if the property is used by a directive' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     inputs :  [ 'invalidProp' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( ( )  = >  parse ( '<div [invalid-prop]></div>' ,  [ dirA ] ) ) . not . toThrow ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should not allow more than 1 component per element' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     isComponent : true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     template : compileTemplateMetadata ( { ngContentSelectors :  [ ] } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  dirB  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     isComponent : true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirB' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     template : compileTemplateMetadata ( { ngContentSelectors :  [ ] } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( ( )  = >  parse ( '<div>' ,  [ dirB ,  dirA ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          . toThrowError ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              ` Template parse errors: \ n `  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              ` More than one component matched on this element. \ n `  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              ` Make sure that only one component's selector can match a given element. \ n `  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              ` Conflicting components: DirB,DirA ("[ERROR ->]<div>"): TestComp@0:0 ` ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should not allow components or element bindings nor dom events on explicit embedded templates' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        selector :  '[a]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        isComponent : true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        template : compileTemplateMetadata ( { ngContentSelectors :  [ ] } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                      } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         expect ( ( )  = >  parse ( '<ng-template [a]="b" (e)="f"></ng-template>' ,  [ dirA ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Event  binding  e  not  emitted  by  any  directive  on  an  embedded  template .  Make  sure  that  the  event  name  is  spelled  correctly  and  all  directives  are  listed  in  the  "@NgModule.declarations" .  ( "<ng-template [a]=" b " [ERROR ->](e)=" f "></ng-template>" ) :  TestComp @0 : 21  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Components  on  an  embedded  template : DirA  ( "[ERROR ->]<ng-template [a]=" b " (e)=" f "></ng-template>" ) :  TestComp @0 : 0  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Property  binding  a  not  used  by  any  directive  on  an  embedded  template .  Make  sure  that  the  property  name  is  spelled  correctly  and  all  directives  are  listed  in  the  "@NgModule.declarations" .  ( "[ERROR ->]<ng-template [a]=" b " (e)=" f "></ng-template>" ) :  TestComp @0 : 0 ` );
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should not allow components or element bindings on inline embedded templates' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     selector :  '[a]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     isComponent : true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     template : compileTemplateMetadata ( { ngContentSelectors :  [ ] } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( ( )  = >  parse ( '<div *a="b"></div>' ,  [ dirA ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Components  on  an  embedded  template : DirA  ( "[ERROR ->]<div *a=" b "></div>" ) :  TestComp @0 : 0  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Property  binding  a  not  used  by  any  directive  on  an  embedded  template .  Make  sure  that  the  property  name  is  spelled  correctly  and  all  directives  are  listed  in  the  "@NgModule.declarations" .  ( "[ERROR ->]<div *a=" b "></div>" ) :  TestComp @0 : 0 ` );
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  describe ( 'ignore elements' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should ignore <script> elements' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parse ( '<script></script>a' ,  [ ] ) ) ) . toEqual ( [ [ TextAst ,  'a' ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should ignore <style> elements' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parse ( '<style></style>a' ,  [ ] ) ) ) . toEqual ( [ [ TextAst ,  'a' ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    describe ( '<link rel="stylesheet">' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      it ( 'should keep <link rel="stylesheet"> elements if they have an absolute url' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<link rel="stylesheet" href="http://someurl">a' ,  [ ] ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            . toEqual ( [ 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								              [ ElementAst ,  'link' ] ,  [ AttrAst ,  'rel' ,  'stylesheet' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              [ AttrAst ,  'href' ,  'http://someurl' ] ,  [ TextAst ,  'a' ] 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should keep <link rel="stylesheet"> elements if they have no uri' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<link rel="stylesheet">a' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'link' ] ,  [ AttrAst ,  'rel' ,  'stylesheet' ] ,  [ TextAst ,  'a' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<link REL="stylesheet">a' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ ElementAst ,  'link' ] ,  [ AttrAst ,  'REL' ,  'stylesheet' ] ,  [ TextAst ,  'a' ] 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should ignore <link rel="stylesheet"> elements if they have a relative uri' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<link rel="stylesheet" href="./other.css">a' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ TextAst ,  'a' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<link rel="stylesheet" HREF="./other.css">a' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          [ TextAst ,  'a' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      it ( 'should ignore <link rel="stylesheet"> elements if they have a package: uri' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        expect ( humanizeTplAst ( parse ( '<link rel="stylesheet" href="package:somePackage">a' ,  [ ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . toEqual ( [ [ TextAst ,  'a' ] ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should ignore bindings on children of elements with ngNonBindable' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parse ( '<div ngNonBindable>{{b}}</div>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ ElementAst ,  'div' ] ,  [ AttrAst ,  'ngNonBindable' ,  '' ] ,  [ TextAst ,  '{{b}}' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should keep nested children of elements with ngNonBindable' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parse ( '<div ngNonBindable><span>{{b}}</span></div>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ ElementAst ,  'div' ] ,  [ AttrAst ,  'ngNonBindable' ,  '' ] ,  [ ElementAst ,  'span' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ TextAst ,  '{{b}}' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should ignore <script> elements inside of elements with ngNonBindable' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parse ( '<div ngNonBindable><script></script>a</div>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ ElementAst ,  'div' ] ,  [ AttrAst ,  'ngNonBindable' ,  '' ] ,  [ TextAst ,  'a' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should ignore <style> elements inside of elements with ngNonBindable' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parse ( '<div ngNonBindable><style></style>a</div>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ ElementAst ,  'div' ] ,  [ AttrAst ,  'ngNonBindable' ,  '' ] ,  [ TextAst ,  'a' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should ignore <link rel="stylesheet"> elements inside of elements with ngNonBindable' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         expect ( humanizeTplAst ( parse ( '<div ngNonBindable><link rel="stylesheet">a</div>' ,  [ ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             . toEqual ( [ [ ElementAst ,  'div' ] ,  [ AttrAst ,  'ngNonBindable' ,  '' ] ,  [ TextAst ,  'a' ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should convert <ng-content> elements into regular elements inside of elements with ngNonBindable' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         expect ( humanizeTplAst ( parse ( '<div ngNonBindable><ng-content></ng-content>a</div>' ,  [ ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               [ ElementAst ,  'div' ] ,  [ AttrAst ,  'ngNonBindable' ,  '' ] ,  [ ElementAst ,  'ng-content' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               [ TextAst ,  'a' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  describe ( 'source spans' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should support ng-content' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  parsed  =  parse ( '<ng-content select="a">' ,  [ ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAstSourceSpans ( parsed ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ NgContentAst ,  '<ng-content select="a">' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should support embedded template' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAstSourceSpans ( parse ( '<ng-template></ng-template>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-26 11:56:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        [ EmbeddedTemplateAst ,  '<ng-template></ng-template>' ] 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should support element and attributes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAstSourceSpans ( parse ( '<div key=value>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ ElementAst ,  'div' ,  '<div key=value>' ] ,  [ AttrAst ,  'key' ,  'value' ,  'key=value' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should support references' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAstSourceSpans ( parse ( '<div #a></div>' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-26 11:56:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        [ ElementAst ,  'div' ,  '<div #a></div>' ] ,  [ ReferenceAst ,  'a' ,  null ,  '#a' ] 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-09 14:42:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-01-10 19:07:03 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should support variables' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAstSourceSpans ( parse ( '<ng-template let-a="b"></ng-template>' ,  [ ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          . toEqual ( [ 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-26 11:56:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            [ EmbeddedTemplateAst ,  '<ng-template let-a="b"></ng-template>' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            [ VariableAst ,  'a' ,  'b' ,  'let-a="b"' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-28 15:58:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should support events' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAstSourceSpans ( parse ( '<div (window:event)="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ ElementAst ,  'div' ,  '<div (window:event)="v">' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ BoundEventAst ,  'event' ,  'window' ,  'v' ,  '(window:event)="v"' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should support element property' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAstSourceSpans ( parse ( '<div [someProp]="v">' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ ElementAst ,  'div' ,  '<div [someProp]="v">' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          BoundElementPropertyAst ,  PropertyBindingType . Property ,  'someProp' ,  'v' ,  null , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          '[someProp]="v"' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-28 15:58:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should support bound text' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAstSourceSpans ( parse ( '{{a}}' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ BoundTextAst ,  '{{ a }}' ,  '{{a}}' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-18 15:00:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should support text nodes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAstSourceSpans ( parse ( 'a' ,  [ ] ) ) ) . toEqual ( [ [ TextAst ,  'a' ,  'a' ] ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should support directive' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     selector :  '[a]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  comp  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     isComponent : true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'ZComp' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     template : compileTemplateMetadata ( { ngContentSelectors :  [ ] } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAstSourceSpans ( parse ( '<div a>' ,  [ dirA ,  comp ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ ElementAst ,  'div' ,  '<div a>' ] ,  [ AttrAst ,  'a' ,  '' ,  'a' ] ,  [ DirectiveAst ,  dirA ,  '<div a>' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ DirectiveAst ,  comp ,  '<div a>' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-18 15:00:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should support directive in namespace' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  tagSel  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  'circle' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'elDir' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  attrSel  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            selector :  '[href]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'attrDir' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAstSourceSpans ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 parse ( '<svg><circle /><use xlink:href="Port" /></svg>' ,  [ tagSel ,  attrSel ] ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          . toEqual ( [ 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-26 11:56:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            [ ElementAst ,  ':svg:svg' ,  '<svg><circle /><use xlink:href="Port" /></svg>' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            [ ElementAst ,  ':svg:circle' ,  '<circle />' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            [ DirectiveAst ,  tagSel ,  '<circle />' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            [ ElementAst ,  ':svg:use' ,  '<use xlink:href="Port" />' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            [ AttrAst ,  ':xlink:href' ,  'Port' ,  'xlink:href="Port"' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            [ DirectiveAst ,  attrSel ,  '<use xlink:href="Port" />' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should support directive property' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  dirA  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     selector :  'div' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     inputs :  [ 'aProp' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAstSourceSpans ( parse ( '<div [aProp]="foo"></div>' ,  [ dirA ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-26 11:56:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        [ ElementAst ,  'div' ,  '<div [aProp]="foo"></div>' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ DirectiveAst ,  dirA ,  '<div [aProp]="foo"></div>' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        [ BoundDirectivePropertyAst ,  'aProp' ,  'foo' ,  '[aProp]="foo"' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-28 15:58:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    it ( 'should support endSourceSpan for elements' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  tagSel  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       selector :  'circle' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'elDir' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  result  =  parse ( '<circle></circle>' ,  [ tagSel ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  circle  =  result [ 0 ]  as  ElementAst ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( circle . endSourceSpan ) . toBeDefined ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( circle . endSourceSpan ! . start . offset ) . toBe ( 8 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( circle . endSourceSpan ! . end . offset ) . toBe ( 17 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should report undefined for endSourceSpan for elements without an end-tag' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  ulSel  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                      selector :  'ul' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                      type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'ulDir' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  liSel  =  compileDirectiveMetadataCreate ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                      selector :  'li' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                      type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'liDir' } } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  result  =  parse ( '<ul><li><li></ul>' ,  [ ulSel ,  liSel ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  ul  =  result [ 0 ]  as  ElementAst ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  li  =  ul . children [ 0 ]  as  ElementAst ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( li . endSourceSpan ) . toBe ( null ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  describe ( 'pipes' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should allow pipes that have been defined as dependencies' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  testPipe  =  new  CompilePipeMetadata ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         name :  'test' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         type :  createTypeMeta ( { reference :  { filePath : someModuleUrl ,  name :  'DirA' } } ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         pure : false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                       } ) . toSummary ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( ( )  = >  parse ( '{{a | test}}' ,  [ ] ,  [ testPipe ] ) ) . not . toThrow ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should report pipes as error that have not been defined as dependencies' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( ( )  = >  parse ( '{{a | test}}' ,  [ ] ) ) . toThrowError ( ` Template parse errors:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								The  pipe  'test'  could  not  be  found  ( "{{[ERROR ->]a | test}}" ) :  TestComp @0 : 2 ` );
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  describe ( 'ICU messages' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should expand plural messages' ,  ( )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-28 15:58:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      const  shortForm  =  '{ count, plural, =0 {small} many {big} }' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  expandedForm  =  '<ng-container [ngPlural]="count">'  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          '<ng-template ngPluralCase="=0">small</ng-template>'  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          '<ng-template ngPluralCase="many">big</ng-template>'  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          '</ng-container>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parse ( shortForm ,  [ ] ) ) ) . toEqual ( humanizeTplAst ( parse ( expandedForm ,  [ ] ) ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should expand select messages' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  shortForm  =  '{ sex, select, female {foo} other {bar} }' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  expandedForm  =  '<ng-container [ngSwitch]="sex">'  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          '<ng-template ngSwitchCase="female">foo</ng-template>'  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          '<ng-template ngSwitchDefault>bar</ng-template>'  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          '</ng-container>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parse ( shortForm ,  [ ] ) ) ) . toEqual ( humanizeTplAst ( parse ( expandedForm ,  [ ] ) ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    it ( 'should be possible to escape ICU messages' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const  escapedForm  =  'escaped {{ "{" }}  }' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      expect ( humanizeTplAst ( parse ( escapedForm ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ BoundTextAst ,  'escaped {{ "{" }}  }' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-28 15:58:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								describe ( 'whitespaces removal' ,  ( )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  beforeEach ( ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    TestBed . configureCompiler ( { providers :  [ TEST_COMPILER_PROVIDERS ,  MOCK_SCHEMA_REGISTRY ] } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  commonBeforeEach ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  it ( 'should not remove whitespaces by default' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expect ( humanizeTplAst ( parse ( ' <br>  <br>\t<br>\n<br> ' ,  [ ] ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ TextAst ,  ' ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ ElementAst ,  'br' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ TextAst ,  '  ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ ElementAst ,  'br' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ TextAst ,  '\t' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ ElementAst ,  'br' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ TextAst ,  '\n' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ ElementAst ,  'br' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ TextAst ,  ' ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  it ( 'should replace each &ngsp; with a space when preserveWhitespaces is true' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expect ( humanizeTplAst ( parse ( 'foo&ngsp;&ngsp;&ngsp;bar' ,  [ ] ,  [ ] ,  [ ] ,  true ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ TextAst ,  'foo   bar' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  it ( 'should replace every &ngsp; with a single space when preserveWhitespaces is false' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expect ( humanizeTplAst ( parse ( 'foo&ngsp;&ngsp;&ngsp;bar' ,  [ ] ,  [ ] ,  [ ] ,  false ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ TextAst ,  'foo bar' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  it ( 'should remove whitespaces when explicitly requested' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expect ( humanizeTplAst ( parse ( ' <br>  <br>\t<br>\n<br> ' ,  [ ] ,  [ ] ,  [ ] ,  false ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ ElementAst ,  'br' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ ElementAst ,  'br' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ ElementAst ,  'br' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [ ElementAst ,  'br' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-28 15:58:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 10:14:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  it ( 'should remove whitespace between ICU expansions when not preserving whitespaces' ,  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  shortForm  =  '{ count, plural, =0 {small} many {big} }' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  expandedForm  =  '<ng-container [ngPlural]="count">'  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        '<ng-template ngPluralCase="=0">small</ng-template>'  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        '<ng-template ngPluralCase="many">big</ng-template>'  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        '</ng-container>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const  humanizedExpandedForm  =  humanizeTplAst ( parse ( expandedForm ,  [ ] ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    // ICU expansions are converted to `<ng-container>` tags and all blank text nodes are reomved
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    // so any whitespace between ICU exansions are removed as well
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    expect ( humanizeTplAst ( parse ( ` ${ shortForm }   ${ shortForm } ` ,  [ ] ,  [ ] ,  [ ] ,  false ) ) ) . toEqual ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      . . . humanizedExpandedForm ,  . . . humanizedExpandedForm 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ) ;  
						 
					
						
							
								
									
										
										
										
											2017-12-16 14:42:55 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ) ( ) ;