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

15 lines
422 B
JavaScript
Raw Normal View History

2024-10-02 15:15:21 -05:00
import BaseJSNode from './BaseJSNode.js';
export default class WhileStatement extends BaseJSNode {
run() {
while (this.visitor.visitNode(this.node.test)) {
const body = this.visitor.visitNode(this.node.body);
if (body === 'break')
break;
if (body === 'continue')
continue;
if (body)
return body;
}
}
}