Method
bindName
(
name: string,
id: Node,
kind: BindingKind,
declaration: Node,
scope = this.scope
)
Source from the content-addressed store, hash-verified
| 593 | } |
| 594 | |
| 595 | private bindName( |
| 596 | name: string, |
| 597 | id: Node, |
| 598 | kind: BindingKind, |
| 599 | declaration: Node, |
| 600 | scope = this.scope |
| 601 | ): void { |
| 602 | // a name declared again, like a merged enum, is not static |
| 603 | const existing = scope.bindings[name] |
| 604 | if (existing) { |
| 605 | existing.writes.push(id) |
| 606 | this.bindingsById.set(id, existing) |
| 607 | return |
| 608 | } |
| 609 | const binding: Binding = { |
| 610 | name, |
| 611 | kind, |
| 612 | id, |
| 613 | declaration, |
| 614 | scope, |
| 615 | references: [], |
| 616 | writes: [], |
| 617 | exportNames: [], |
| 618 | isAmbient: false |
| 619 | } |
| 620 | scope.bindings[name] = binding |
| 621 | this.bindingsById.set(id, binding) |
| 622 | } |
| 623 | |
| 624 | private reference( |
| 625 | id: IdentifierReference | JSXIdentifier, |
Tested by
no test coverage detected