MCPcopy Create free account
hub / github.com/codecombat/codecombat / countBlocks

Function countBlocks

app/core/blocklyUtils.js:1253–1261  ·  view source on GitHub ↗
(newState)

Source from the content-addressed store, hash-verified

1251}
1252
1253function countBlocks (newState) {
1254 // TODO: this should probably count nested blocks, arguments, also account for taller blocks. But, not important with auto blockly.cleanUp() function.
1255 let count = 0
1256 while (newState?.next) {
1257 ++count
1258 newState = newState.next.block
1259 }
1260 return count
1261}
1262
1263const filterBlocklyState = function (blocklyState, blockType) {
1264 // Stubs out all blocks of the given type from the blockly state. Useful for not throwing away all code just because a block definition is missing.

Callers 1

mergeBlocklyStatesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected