MCPcopy
hub / github.com/ajv-validator/ajv / endBlock

Method endBlock

lib/compile/codegen/index.ts:705–714  ·  view source on GitHub ↗
(nodeCount?: number)

Source from the content-addressed store, hash-verified

703
704 // end the current self-balancing block
705 endBlock(nodeCount?: number): CodeGen {
706 const len = this._blockStarts.pop()
707 if (len === undefined) throw new Error("CodeGen: not in self-balancing block")
708 const toClose = this._nodes.length - len
709 if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {
710 throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`)
711 }
712 this._nodes.length = len
713 return this
714 }
715
716 // `function` heading (or definition if funcBody is passed)
717 func(name: Name, args: Code = nil, async?: boolean, funcBody?: Block): CodeGen {

Callers 2

blockMethod · 0.80
codegen.spec.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected