From 6656328538554651720fc99c5f70bea75007ff5a Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Thu, 31 Jan 2019 11:44:27 +0100 Subject: [PATCH] refactor(ivy): adjust types, limit usage of global state (#28473) PR Close #28473 --- packages/core/src/render3/instructions.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/core/src/render3/instructions.ts b/packages/core/src/render3/instructions.ts index e8310d54ae..c7b5e7935c 100644 --- a/packages/core/src/render3/instructions.ts +++ b/packages/core/src/render3/instructions.ts @@ -2091,23 +2091,23 @@ export function template( localRefExtractor?: LocalRefExtractor) { const lView = getLView(); const tView = lView[TVIEW]; - // TODO: consider a separate node type for templates - const tNode = containerInternal(index, tagName || null, attrs || null); + // TODO: consider a separate node type for templates + const tContainerNode = containerInternal(index, tagName || null, attrs || null); if (tView.firstTemplatePass) { - tNode.tViews = createTView( + tContainerNode.tViews = createTView( -1, templateFn, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null); } createDirectivesAndLocals(tView, lView, localRefs, localRefExtractor); + const currentQueries = lView[QUERIES]; - const previousOrParentTNode = getPreviousOrParentTNode(); - const native = getNativeByTNode(previousOrParentTNode, lView); - attachPatchData(native, lView); if (currentQueries) { - lView[QUERIES] = currentQueries.addNode(previousOrParentTNode as TContainerNode); + lView[QUERIES] = currentQueries.addNode(tContainerNode); } - registerPostOrderHooks(tView, tNode); + + attachPatchData(getNativeByTNode(tContainerNode, lView), lView); + registerPostOrderHooks(tView, tContainerNode); setIsParent(false); } @@ -2130,7 +2130,7 @@ export function container(index: number): void { } function containerInternal( - index: number, tagName: string | null, attrs: TAttributes | null): TNode { + index: number, tagName: string | null, attrs: TAttributes | null): TContainerNode { const lView = getLView(); ngDevMode && assertEqual( lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex,