* Walks down a stack of blocks and finds the last next connection on the * stack. * * @param ignoreShadows If true,the last connection on a non-shadow block will * be returned. If false, this will follow shadows to find the last * connection. * @returns The last next connec
(ignoreShadows: boolean)
| 565 | * @internal |
| 566 | */ |
| 567 | lastConnectionInStack(ignoreShadows: boolean): Connection | null { |
| 568 | let nextConnection = this.nextConnection; |
| 569 | while (nextConnection) { |
| 570 | const nextBlock = nextConnection.targetBlock(); |
| 571 | if (!nextBlock || (ignoreShadows && nextBlock.isShadow())) { |
| 572 | return nextConnection; |
| 573 | } |
| 574 | nextConnection = nextBlock.nextConnection; |
| 575 | } |
| 576 | return null; |
| 577 | } |
| 578 | |
| 579 | /** |
| 580 | * Bump unconnected blocks out of alignment. Two blocks which aren't actually |
no test coverage detected