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

11 lines
373 B
JavaScript

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