@@ -97,9 +97,9 @@ export class LQueries_ implements LQueries {
97
97
track < T > ( queryList : QueryList < T > , predicate : Type < T > | string [ ] , descend ?: boolean , read ?: Type < T > ) :
98
98
void {
99
99
if ( descend ) {
100
- this . deep = createQuery ( this . deep , queryList , predicate , read != null ? read : null ) ;
100
+ this . deep = createLQuery ( this . deep , queryList , predicate , read != null ? read : null ) ;
101
101
} else {
102
- this . shallow = createQuery ( this . shallow , queryList , predicate , read != null ? read : null ) ;
102
+ this . shallow = createLQuery ( this . shallow , queryList , predicate , read != null ? read : null ) ;
103
103
}
104
104
}
105
105
@@ -346,7 +346,7 @@ function createPredicate<T>(predicate: Type<T>| string[], read: Type<T>| null):
346
346
} ;
347
347
}
348
348
349
- function createQuery < T > (
349
+ function createLQuery < T > (
350
350
previous : LQuery < any > | null , queryList : QueryList < T > , predicate : Type < T > | string [ ] ,
351
351
read : Type < T > | null ) : LQuery < T > {
352
352
return {
@@ -361,14 +361,14 @@ function createQuery<T>(
361
361
type QueryList_ < T > = QueryList < T > & { _valuesTree : any [ ] , _static : boolean } ;
362
362
363
363
/**
364
- * Creates and returns a QueryList .
364
+ * Creates a QueryList and stores it in LView's collection of active queries (LQueries) .
365
365
*
366
366
* @param predicate The type for which the query will search
367
367
* @param descend Whether or not to descend into children
368
368
* @param read What to save in the query
369
369
* @returns QueryList<T>
370
370
*/
371
- function query < T > (
371
+ function createQueryListInLView < T > (
372
372
// TODO: "read" should be an AbstractType (FW-486)
373
373
lView : LView , predicate : Type < any > | string [ ] , descend : boolean , read : any ,
374
374
isStatic : boolean ) : QueryList < T > {
@@ -447,7 +447,8 @@ function viewQueryInternal<T>(
447
447
tView . expandoStartIndex ++ ;
448
448
}
449
449
const index = getCurrentQueryIndex ( ) ;
450
- const queryList : QueryList < T > = query < T > ( lView , predicate , descend , read , isStatic ) ;
450
+ const queryList : QueryList < T > =
451
+ createQueryListInLView < T > ( lView , predicate , descend , read , isStatic ) ;
451
452
store ( index - HEADER_OFFSET , queryList ) ;
452
453
setCurrentQueryIndex ( index + 1 ) ;
453
454
return queryList ;
@@ -490,7 +491,8 @@ function contentQueryInternal<T>(
490
491
descend : boolean ,
491
492
// TODO(FW-486): "read" should be an AbstractType
492
493
read : any , isStatic : boolean ) : QueryList < T > {
493
- const contentQuery : QueryList < T > = query < T > ( lView , predicate , descend , read , isStatic ) ;
494
+ const contentQuery : QueryList < T > =
495
+ createQueryListInLView < T > ( lView , predicate , descend , read , isStatic ) ;
494
496
( lView [ CONTENT_QUERIES ] || ( lView [ CONTENT_QUERIES ] = [ ] ) ) . push ( contentQuery ) ;
495
497
if ( tView . firstTemplatePass ) {
496
498
const tViewContentQueries = tView . contentQueries || ( tView . contentQueries = [ ] ) ;
0 commit comments