MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / children

Method children

website/public/wasm/web-tree-sitter.js:918–935  ·  view source on GitHub ↗

* Iterate over this node's children. * * If you're walking the tree recursively, you may want to use the * TreeCursor APIs directly instead.

()

Source from the content-addressed store, hash-verified

916 * {@link TreeCursor} APIs directly instead.
917 */
918 get children() {
919 if (!this._children) {
920 marshalNode(this);
921 C._ts_node_children_wasm(this.tree[0]);
922 const count = C.getValue(TRANSFER_BUFFER, "i32");
923 const buffer = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
924 this._children = new Array(count);
925 if (count > 0) {
926 let address = buffer;
927 for (let i2 = 0; i2 < count; i2++) {
928 this._children[i2] = unmarshalNode(this.tree, address);
929 address += SIZE_OF_NODE;
930 }
931 C._free(buffer);
932 }
933 }
934 return this._children;
935 }
936 /**
937 * Iterate over this node's named children.
938 *

Callers

nothing calls this directly

Calls 3

marshalNodeFunction · 0.85
unmarshalNodeFunction · 0.85
getValueMethod · 0.45

Tested by

no test coverage detected