refactor(core): Remove host TNode from getOrCreateTNode (#38707)

Host `TNode` was passed into `getOrCreateTNode` just so that we can
compute weather or not we are a root node. This was needed because
`previousOrParentTNode` could have `TNode` from `TView` other then
current `TView`. This is confusing mental model. Previous change
ensured that `previousOrParentTNode` must always be part of `TView`,
which enabled this change to remove the unneeded argument.

PR Close #38707
This commit is contained in:
Misko Hevery
2020-09-04 13:03:46 -07:00
parent 33aaa9e7d0
commit bc6ff7745e
14 changed files with 40 additions and 41 deletions

View File

@ -278,7 +278,7 @@ export function renderTemplate<T>(
def.pipeDefs = pipes || null;
const componentTView = getOrCreateTComponentView(def);
const hostTNode = getOrCreateTNode(tView, hostLView[T_HOST], 0, TNodeType.Element, null, null);
const hostTNode = getOrCreateTNode(tView, 0, TNodeType.Element, null, null);
hostLView[hostTNode.index] = hostNode;
componentView = createLView(
hostLView, componentTView, context, LViewFlags.CheckAlways, hostNode, hostTNode,