refactor(ivy): clean up RNode retrieval; add better debug support for TNode (#31040)
PR Close #31040
This commit is contained in:

committed by
Miško Hevery

parent
ef75fb8ecd
commit
4495a46b99
@ -14,7 +14,7 @@ import {LContext, MONKEY_PATCH_KEY_NAME} from './interfaces/context';
|
||||
import {TNode, TNodeFlags} from './interfaces/node';
|
||||
import {RElement, RNode} from './interfaces/renderer';
|
||||
import {CONTEXT, HEADER_OFFSET, HOST, LView, TVIEW} from './interfaces/view';
|
||||
import {getComponentViewByIndex, getNativeByTNode, readPatchedData, unwrapRNode} from './util/view_utils';
|
||||
import {getComponentViewByIndex, getNativeByTNodeOrNull, readPatchedData, unwrapRNode} from './util/view_utils';
|
||||
|
||||
|
||||
|
||||
@ -191,7 +191,7 @@ export function isDirectiveInstance(instance: any): boolean {
|
||||
function findViaNativeElement(lView: LView, target: RElement): number {
|
||||
let tNode = lView[TVIEW].firstChild;
|
||||
while (tNode) {
|
||||
const native = getNativeByTNode(tNode, lView) !;
|
||||
const native = getNativeByTNodeOrNull(tNode, lView) !;
|
||||
if (native === target) {
|
||||
return tNode.index;
|
||||
}
|
||||
|
Reference in New Issue
Block a user