refactor(ivy): remove LNode.view (#25988)

PR Close #25988
This commit is contained in:
Kara Erickson
2018-09-17 14:32:45 -07:00
committed by Ben Lesh
parent 5653874683
commit f47f2628e1
14 changed files with 172 additions and 159 deletions

View File

@ -199,7 +199,7 @@ export function getLElementFromRootComponent(rootComponentInstance: {}): LElemen
* that `getContext` has in the event that an Angular application doesn't need to have
* any programmatic access to an element's context (only change detection uses this function).
*/
export function getLElementFromComponent(componentInstance: {}): LElementNode|null {
export function getLElementFromComponent(componentInstance: {}): LElementNode {
let lViewData = readPatchedData(componentInstance);
let lNode: LElementNode;
@ -355,10 +355,9 @@ function getLNodeFromViewData(lViewData: LViewData, lElementIndex: number): LEle
*/
function discoverDirectiveIndices(lViewData: LViewData, lNodeIndex: number): number[]|null {
const directivesAcrossView = lViewData[DIRECTIVES];
const lNode = getLNodeFromViewData(lViewData, lNodeIndex);
const tNode = lViewData[TVIEW].data[lNodeIndex] as TNode;
if (lNode && directivesAcrossView && directivesAcrossView.length) {
// this check for tNode is to determine if the calue is a LEmementNode instance
if (directivesAcrossView && directivesAcrossView.length) {
// this check for tNode is to determine if the value is a LElementNode instance
const directiveIndexStart = getDirectiveStartIndex(tNode);
const directiveIndexEnd = getDirectiveEndIndex(tNode, directiveIndexStart);
const directiveIndices: number[] = [];