From 60fecc1284b7fbfe7a9255e9f2cdbd859e7c915f Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Mon, 14 Jan 2019 21:36:04 +0100 Subject: [PATCH] fixup! refactor(ivy): simplify context discover based on feedback (#28101) PR Close #28101 --- packages/core/src/render3/context_discovery.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/core/src/render3/context_discovery.ts b/packages/core/src/render3/context_discovery.ts index 47a1ea1350..a41ffd128c 100644 --- a/packages/core/src/render3/context_discovery.ts +++ b/packages/core/src/render3/context_discovery.ts @@ -300,14 +300,9 @@ export function discoverLocalRefs(lView: LView, nodeIndex: number): {[key: strin if (tNode && tNode.localNames) { const result: {[key: string]: any} = {}; let localIndex = tNode.index + 1; - for (let i = 0; i < tNode.localNames.length; i += 2, localIndex++) { - const localRefName = tNode.localNames[i]; - const directiveIndex = tNode.localNames[i + 1] as number; - if (directiveIndex === -1) { - result[localRefName] = lView[localIndex] || getNativeByTNode(tNode, lView); - } else { - result[localRefName] = lView[directiveIndex]; - } + for (let i = 0; i < tNode.localNames.length; i += 2) { + result[tNode.localNames[i]] = lView[localIndex]; + localIndex++; } return result; }