MCPcopy
hub / github.com/RaspberryPiFoundation/blockly / lastConnectionInStack

Method lastConnectionInStack

packages/blockly/core/block.ts:567–577  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 5

callbackFunction · 0.45
isNavigableMethod · 0.45
getLocalConnectionsMethod · 0.45

Calls 2

isShadowMethod · 0.80
targetBlockMethod · 0.45

Tested by

no test coverage detected