MCPcopy Index your code
hub / github.com/gpujs/gpu.js / toJSON

Method toJSON

src/backend/function-builder.js:374–388  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

372 }
373
374 toJSON() {
375 return this.traceFunctionCalls(this.rootNode.name).reverse().map(name => {
376 const nativeIndex = this.nativeFunctions.indexOf(name);
377 if (nativeIndex > -1) {
378 return {
379 name,
380 source: this.nativeFunctions[nativeIndex].source
381 };
382 } else if (this.functionMap[name]) {
383 return this.functionMap[name].toJSON();
384 } else {
385 throw new Error(`function ${ name } not found`);
386 }
387 });
388 }
389
390 fromJSON(jsonFunctionNodes, FunctionNode) {
391 this.functionMap = {};

Callers

nothing calls this directly

Calls 1

traceFunctionCallsMethod · 0.95

Tested by

no test coverage detected