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

9 lines
329 B
JavaScript
Raw Normal View History

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