* Iterate over all functions, calling %%callback%%, sorted by their name.
(callback: (func: FunctionFragment, index: number) => void)
| 571 | * Iterate over all functions, calling %%callback%%, sorted by their name. |
| 572 | */ |
| 573 | forEachFunction(callback: (func: FunctionFragment, index: number) => void): void { |
| 574 | const names = Array.from(this.#functions.keys()); |
| 575 | names.sort((a, b) => a.localeCompare(b)); |
| 576 | for (let i = 0; i < names.length; i++) { |
| 577 | const name = names[i]; |
| 578 | callback(<FunctionFragment>(this.#functions.get(name)), i); |
| 579 | } |
| 580 | } |
| 581 | |
| 582 | |
| 583 | // Find an event definition by any means necessary (unless it is ambiguous) |