@@ -36,7 +36,7 @@ import {SanitizerFn} from './interfaces/sanitization';
36
36
import { StylingContext } from './interfaces/styling' ;
37
37
import { BINDING_INDEX , CHILD_HEAD , CHILD_TAIL , CLEANUP , CONTEXT , DECLARATION_VIEW , ExpandoInstructions , FLAGS , HEADER_OFFSET , HOST , INJECTOR , InitPhaseState , LView , LViewFlags , NEXT , OpaqueViewState , PARENT , QUERIES , RENDERER , RENDERER_FACTORY , RootContext , RootContextFlags , SANITIZER , TData , TVIEW , TView , T_HOST } from './interfaces/view' ;
38
38
import { assertNodeOfPossibleTypes , assertNodeType } from './node_assert' ;
39
- import { appendChild , appendProjectedNode , createTextNode , getLViewChild , insertView , removeView } from './node_manipulation' ;
39
+ import { appendChild , appendProjectedNode , createTextNode , insertView , removeView } from './node_manipulation' ;
40
40
import { isNodeMatchingSelectorList , matchingSelectorIndex } from './node_selector_matcher' ;
41
41
import { decreaseElementDepthCount , enterView , getBindingsEnabled , getCheckNoChangesMode , getContextLView , getCurrentDirectiveDef , getElementDepthCount , getIsParent , getLView , getPreviousOrParentTNode , increaseElementDepthCount , isCreationMode , leaveView , nextContextImpl , resetComponentState , setBindingRoot , setCheckNoChangesMode , setCurrentDirectiveDef , setCurrentQueryIndex , setIsParent , setPreviousOrParentTNode , } from './state' ;
42
42
import { getInitialClassNameValue , getInitialStyleStringValue , initializeStaticContext as initializeStaticStylingContext , patchContextWithStaticAttrs , renderInitialClasses , renderInitialStyles , renderStyling , updateClassProp as updateElementClassProp , updateContextWithBindings , updateStyleProp as updateElementStyleProp , updateStylingMap } from './styling/class_and_style_bindings' ;
@@ -788,7 +788,6 @@ export function createTView(
788
788
viewQuery : viewQuery ,
789
789
node : null ! ,
790
790
data : blueprint . slice ( ) . fill ( null , bindingStartIndex ) ,
791
- childIndex : - 1 , // Children set in addToViewTree(), if any
792
791
bindingStartIndex : bindingStartIndex ,
793
792
viewQueryStartIndex : initialViewLength ,
794
793
expandoStartIndex : initialViewLength ,
@@ -2373,7 +2372,7 @@ export function containerRefreshEnd(): void {
2373
2372
* by executing an associated template function.
2374
2373
*/
2375
2374
function refreshDynamicEmbeddedViews ( lView : LView ) {
2376
- for ( let current = getLViewChild ( lView ) ; current !== null ; current = current [ NEXT ] ) {
2375
+ for ( let current = lView [ CHILD_HEAD ] ; current !== null ; current = current [ NEXT ] ) {
2377
2376
// Note: current can be an LView or an LContainer instance, but here we are only interested
2378
2377
// in LContainer. We can tell it's an LContainer because its length is less than the LView
2379
2378
// header.
@@ -2704,13 +2703,14 @@ export function projection(nodeIndex: number, selectorIndex: number = 0, attrs?:
2704
2703
*
2705
2704
* @param lView The view where LView or LContainer should be added
2706
2705
* @param adjustedHostIndex Index of the view's host node in LView[], adjusted for header
2707
- * @param state The LView or LContainer to add to the view tree
2706
+ * @param lViewOrLContainer The LView or LContainer to add to the view tree
2708
2707
* @returns The state passed in
2709
2708
*/
2710
2709
export function addToViewTree < T extends LView | LContainer > ( lView : LView , lViewOrLContainer : T ) : T {
2711
2710
// TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer to
2712
- // the end of the queue, which means if the developer asks for the LContainers out of order, the
2713
- // change detection will run out of order.
2711
+ // the end of the queue, which means if the developer retrieves the LContainers from RNodes out of
2712
+ // order, the change detection will run out of order, as the act of retrieving the the LContainer
2713
+ // from the RNode is what adds it to the queue.
2714
2714
if ( lView [ CHILD_HEAD ] ) {
2715
2715
lView [ CHILD_TAIL ] ! [ NEXT ] = lViewOrLContainer ;
2716
2716
} else {
0 commit comments