(name string)
| 1625 | } |
| 1626 | |
| 1627 | func (b *Binder) declareCommonJSVariable(name string) { |
| 1628 | locals := ast.GetLocals(b.file.AsNode()) |
| 1629 | if locals[name] == nil { |
| 1630 | symbol := b.newSymbol(ast.SymbolFlagsFunctionScopedVariable|ast.SymbolFlagsModuleExports, name) |
| 1631 | symbol.Declarations = b.newSingleDeclaration(b.file.AsNode()) |
| 1632 | symbol.ValueDeclaration = symbol.Declarations[0] |
| 1633 | if name == "module" { |
| 1634 | exportsProperty := b.newSymbol(ast.SymbolFlagsModuleExports|ast.SymbolFlagsProperty, "exports") |
| 1635 | exportsProperty.Declarations = symbol.Declarations |
| 1636 | exportsProperty.ValueDeclaration = symbol.ValueDeclaration |
| 1637 | exportsProperty.Parent = symbol |
| 1638 | symbol.Members = make(ast.SymbolTable, 1) |
| 1639 | symbol.Members["exports"] = exportsProperty |
| 1640 | } |
| 1641 | locals[name] = symbol |
| 1642 | } |
| 1643 | } |
| 1644 | |
| 1645 | func (b *Binder) bindChildren(node *ast.Node) { |
| 1646 | saveInAssignmentPattern := b.inAssignmentPattern |
no test coverage detected