mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 20:37:00 -05:00
Assert getExportEqualsLocalSymbol returns a defined result (#21831)
This commit is contained in:
@@ -577,17 +577,17 @@ namespace ts.FindAllReferences {
|
||||
|
||||
function getExportEqualsLocalSymbol(importedSymbol: Symbol, checker: TypeChecker): Symbol {
|
||||
if (importedSymbol.flags & SymbolFlags.Alias) {
|
||||
return checker.getImmediateAliasedSymbol(importedSymbol);
|
||||
return Debug.assertDefined(checker.getImmediateAliasedSymbol(importedSymbol));
|
||||
}
|
||||
|
||||
const decl = importedSymbol.valueDeclaration;
|
||||
if (isExportAssignment(decl)) { // `export = class {}`
|
||||
return decl.expression.symbol;
|
||||
return Debug.assertDefined(decl.expression.symbol);
|
||||
}
|
||||
else if (isBinaryExpression(decl)) { // `module.exports = class {}`
|
||||
return decl.right.symbol;
|
||||
return Debug.assertDefined(decl.right.symbol);
|
||||
}
|
||||
Debug.fail();
|
||||
return Debug.fail();
|
||||
}
|
||||
|
||||
// If a reference is a class expression, the exported node would be its parent.
|
||||
|
||||
Reference in New Issue
Block a user