* Registers a structured import request and returns its binding.
(input: Import)
| 555 | * Registers a structured import request and returns its binding. |
| 556 | */ |
| 557 | addImport(input: Import): Binding { |
| 558 | const key = JSON.stringify([importKey(input), input.local, input.typeOnly]) |
| 559 | const existing = this.#imports.get(key) |
| 560 | if (existing !== undefined) return existing |
| 561 | const result = imported(input) |
| 562 | this.#imports.set(key, result) |
| 563 | this.#importOrder.push(result) |
| 564 | return result |
| 565 | } |
| 566 | |
| 567 | /** |
| 568 | * Registers a fixed import binding supplied by surrounding code without emitting its import declaration. |
no test coverage detected