| 136707 | } |
| 136708 | FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol; |
| 136709 | function getExportEqualsLocalSymbol(importedSymbol, checker) { |
| 136710 | if (importedSymbol.flags & 2097152 /* SymbolFlags.Alias */) { |
| 136711 | return ts.Debug.checkDefined(checker.getImmediateAliasedSymbol(importedSymbol)); |
| 136712 | } |
| 136713 | var decl = ts.Debug.checkDefined(importedSymbol.valueDeclaration); |
| 136714 | if (ts.isExportAssignment(decl)) { // `export = class {}` |
| 136715 | return ts.Debug.checkDefined(decl.expression.symbol); |
| 136716 | } |
| 136717 | else if (ts.isBinaryExpression(decl)) { // `module.exports = class {}` |
| 136718 | return ts.Debug.checkDefined(decl.right.symbol); |
| 136719 | } |
| 136720 | else if (ts.isSourceFile(decl)) { // json module |
| 136721 | return ts.Debug.checkDefined(decl.symbol); |
| 136722 | } |
| 136723 | return ts.Debug.fail(); |
| 136724 | } |
| 136725 | // If a reference is a class expression, the exported node would be its parent. |
| 136726 | // If a reference is a variable declaration, the exported node would be the variable statement. |
| 136727 | function getExportNode(parent, node) { |