From ef6830054d13dc22a8b73da562de45841bffb7f5 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 1 Dec 2014 17:59:32 -0800 Subject: [PATCH] addressed CR feedback --- src/compiler/checker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d087059d19e..e5b5299ff44 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4379,8 +4379,8 @@ module ts { function getNarrowedTypeOfSymbol(symbol: Symbol, node: Node) { var type = getTypeOfSymbol(symbol); // Only narrow when symbol is variable of a structured type - if (node && node.parent && (symbol.flags & SymbolFlags.Variable && type.flags & TypeFlags.Structured)) { - loop: while (true) { + if (node && (symbol.flags & SymbolFlags.Variable && type.flags & TypeFlags.Structured)) { + loop: while (node.parent) { var child = node; node = node.parent; var narrowedType = type;