mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Replace a 'forEach' with 'find' (#17499)
This commit is contained in:
@@ -19530,10 +19530,9 @@ namespace ts {
|
||||
// Since the javascript won't do semantic analysis like typescript,
|
||||
// if the javascript file comes before the typescript file and both contain same name functions,
|
||||
// checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function.
|
||||
const firstDeclaration = forEach(localSymbol.declarations,
|
||||
const firstDeclaration = find(localSymbol.declarations,
|
||||
// Get first non javascript function declaration
|
||||
declaration => declaration.kind === node.kind && !isSourceFileJavaScript(getSourceFileOfNode(declaration)) ?
|
||||
declaration : undefined);
|
||||
declaration => declaration.kind === node.kind && !isSourceFileJavaScript(getSourceFileOfNode(declaration)));
|
||||
|
||||
// Only type check the symbol once
|
||||
if (node === firstDeclaration) {
|
||||
|
||||
Reference in New Issue
Block a user