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

@ -230,8 +230,7 @@ describe('di', () => {
LViewFlags.CheckAlways, null, null, {} as any, {} as any);
enterView(contentView);
try {
const parentTNode =
getOrCreateTNode(contentView[TVIEW], null, 0, TNodeType.Element, null, null);
const parentTNode = getOrCreateTNode(contentView[TVIEW], 0, TNodeType.Element, null, null);
// Simulate the situation where the previous parent is not initialized.
// This happens on first bootstrap because we don't init existing values
// so that we have smaller HelloWorld.