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

Method getRootBlock

packages/blockly/core/block.ts:660–669  ·  view source on GitHub ↗

* Return the top-most block in this block's tree. * This will return itself if this block is at the top level. * * @returns The root block.

()

Source from the content-addressed store, hash-verified

658 * @returns The root block.
659 */
660 getRootBlock(): this {
661 let rootBlock: this;
662 /* eslint-disable-next-line @typescript-eslint/no-this-alias */
663 let block: this | null = this;
664 do {
665 rootBlock = block;
666 block = rootBlock.parentBlock_;
667 } while (block);
668 return rootBlock;
669 }
670
671 /**
672 * Walk up from the given block up through the stack of blocks to find

Callers 15

getBeginStackLabelFunction · 0.80
bumpNeighboursMethod · 0.80
neighbourIsInStackMethod · 0.80
callbackFunction · 0.80
bumpAwayFromMethod · 0.80
setStartBlockMethod · 0.80
extractObjectFromEventFunction · 0.80
isNavigableMethod · 0.80
navigateStacksMethod · 0.80
getTargetBlockMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected