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

14 lines
422 B
JavaScript

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;
}
}
}