agsamantha/node_modules/jintr/dist/nodes/IfStatement.js
2024-10-02 15:15:21 -05:00

12 lines
386 B
JavaScript

import BaseJSNode from './BaseJSNode.js';
export default class IfStatement extends BaseJSNode {
run() {
const test = this.visitor.visitNode(this.node.test);
if (test) {
return this.visitor.visitNode(this.node.consequent);
}
else if (this.node.alternate) {
return this.visitor.visitNode(this.node.alternate);
}
}
}