()
| 757 | } |
| 758 | |
| 759 | func (b *Binder) bindSourceFileIfExternalModule() { |
| 760 | b.setExportContextFlag(b.file.AsNode()) |
| 761 | if ast.IsExternalOrCommonJSModule(b.file) { |
| 762 | b.bindSourceFileAsExternalModule() |
| 763 | } else if ast.IsJsonSourceFile(b.file) { |
| 764 | b.bindSourceFileAsExternalModule() |
| 765 | // Create symbol equivalent for the module.exports = {} |
| 766 | originalSymbol := b.file.Symbol |
| 767 | b.declareSymbol(ast.GetSymbolTable(&b.file.Symbol.Exports), b.file.Symbol, b.file.AsNode(), ast.SymbolFlagsProperty, ast.SymbolFlagsAll) |
| 768 | b.file.Symbol = originalSymbol |
| 769 | } |
| 770 | } |
| 771 | |
| 772 | func (b *Binder) bindSourceFileAsExternalModule() { |
| 773 | b.bindAnonymousDeclaration(b.file.AsNode(), ast.SymbolFlagsValueModule, "\""+tspath.RemoveFileExtension(b.file.FileName())+"\"") |
no test coverage detected