From 57f7d7f9dfb05c9e5a87c208e3ab3224be400a73 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 4 Nov 2015 16:44:21 -0800 Subject: [PATCH] Reword predicate to be more readable --- src/compiler/binder.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 57d610c931e..b33f0b95fa3 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -130,12 +130,14 @@ namespace ts { symbol.members = {}; } - if (symbolFlags & SymbolFlags.Value && - (!symbol.valueDeclaration || - (symbol.valueDeclaration.kind === SyntaxKind.ModuleDeclaration && node.kind !== SyntaxKind.ModuleDeclaration))) { - // other kinds of value declarations take precedence over modules - symbol.valueDeclaration = node; - } + if (symbolFlags & SymbolFlags.Value) { + const valueDeclaration = symbol.valueDeclaration; + if (!valueDeclaration || + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === SyntaxKind.ModuleDeclaration)) { + // other kinds of value declarations take precedence over modules + symbol.valueDeclaration = node; + } + } } // Should not be called on a declaration with a computed property name,