()
| 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 = {}; |
nothing calls this directly
no test coverage detected