agsamantha/node_modules/jintr/dist/nodes/IfStatement.js

13 lines
386 B
JavaScript
Raw Normal View History

2024-10-02 15:15:21 -05:00
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);
}
}
}