Skip to content

Commit b0435d8

Browse files
author
Andy
authored
Replace a 'forEach' with 'find' (#17499)
1 parent 2efaa7c commit b0435d8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19530,10 +19530,9 @@ namespace ts {
1953019530
// Since the javascript won't do semantic analysis like typescript,
1953119531
// if the javascript file comes before the typescript file and both contain same name functions,
1953219532
// checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function.
19533-
const firstDeclaration = forEach(localSymbol.declarations,
19533+
const firstDeclaration = find(localSymbol.declarations,
1953419534
// Get first non javascript function declaration
19535-
declaration => declaration.kind === node.kind && !isSourceFileJavaScript(getSourceFileOfNode(declaration)) ?
19536-
declaration : undefined);
19535+
declaration => declaration.kind === node.kind && !isSourceFileJavaScript(getSourceFileOfNode(declaration)));
1953719536

1953819537
// Only type check the symbol once
1953919538
if (node === firstDeclaration) {

0 commit comments

Comments
 (0)