Skip to content

Commit 57f7d7f

Browse files
committed
Reword predicate to be more readable
1 parent ec2eac5 commit 57f7d7f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/compiler/binder.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,14 @@ namespace ts {
130130
symbol.members = {};
131131
}
132132

133-
if (symbolFlags & SymbolFlags.Value &&
134-
(!symbol.valueDeclaration ||
135-
(symbol.valueDeclaration.kind === SyntaxKind.ModuleDeclaration && node.kind !== SyntaxKind.ModuleDeclaration))) {
136-
// other kinds of value declarations take precedence over modules
137-
symbol.valueDeclaration = node;
138-
}
133+
if (symbolFlags & SymbolFlags.Value) {
134+
const valueDeclaration = symbol.valueDeclaration;
135+
if (!valueDeclaration ||
136+
(valueDeclaration.kind !== node.kind && valueDeclaration.kind === SyntaxKind.ModuleDeclaration)) {
137+
// other kinds of value declarations take precedence over modules
138+
symbol.valueDeclaration = node;
139+
}
140+
}
139141
}
140142

141143
// Should not be called on a declaration with a computed property name,

0 commit comments

Comments
 (0)