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

8 lines
329 B
JavaScript

import BaseJSNode from './BaseJSNode.js';
export default class NewExpression extends BaseJSNode {
run() {
const callee = this.visitor.visitNode(this.node.callee);
const args = this.node.arguments.map((arg) => this.visitor.visitNode(arg));
return args.length ? new callee(args) : new callee();
}
}