refactor(ivy): clean up RNode retrieval; add better debug support for TNode (#31040)

PR Close #31040
This commit is contained in:
Misko Hevery
2019-06-14 07:55:17 +02:00
committed by Miško Hevery
parent ef75fb8ecd
commit 4495a46b99
14 changed files with 201 additions and 59 deletions

View File

@ -16,7 +16,7 @@ import {TElementNode, TNode, TNodeType, TViewNode} from './interfaces/node';
import {FLAGS, HOST, LView, LViewFlags, T_HOST} from './interfaces/view';
import {destroyLView, renderDetachView} from './node_manipulation';
import {findComponentView, getLViewParent} from './util/view_traversal_utils';
import {getNativeByTNode} from './util/view_utils';
import {getNativeByTNode, getNativeByTNodeOrNull} from './util/view_utils';
@ -294,7 +294,7 @@ function collectNativeNodes(lView: LView, parentTNode: TNode, result: any[]): an
let tNodeChild = parentTNode.child;
while (tNodeChild) {
const nativeNode = getNativeByTNode(tNodeChild, lView);
const nativeNode = getNativeByTNodeOrNull(tNodeChild, lView);
nativeNode && result.push(nativeNode);
if (tNodeChild.type === TNodeType.ElementContainer) {
collectNativeNodes(lView, tNodeChild, result);