From 54a89ac026a0d31f14461a8ecf6132e9705bbd99 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 15 Feb 2018 12:25:55 -0800 Subject: [PATCH] Simplify bindPropertyAssignment inner loop --- src/compiler/binder.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 640bd37994f..4f139f623b1 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2417,15 +2417,9 @@ namespace ts { addDeclarationToSymbol(original, id, flags); return original; } - else if (symbol) { - symbol.exports = symbol.exports || createSymbolTable(); - symbol = declareSymbol(symbol.exports, symbol, id, flags, excludeFlags); - } else { - Debug.assert(!original); - symbol = declareSymbol(container.locals, /*parent*/ undefined, id, flags, excludeFlags); + return symbol = declareSymbol(symbol ? symbol.exports : container.locals, symbol, id, flags, excludeFlags); } - return symbol; }); } if (!symbol || !(symbol.flags & (SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.NamespaceModule | SymbolFlags.ObjectLiteral))) {