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

15 lines
494 B
JavaScript
Raw Normal View History

2024-10-02 20:15:21 +00:00
import BaseJSNode from './BaseJSNode.js';
export default class Identifier extends BaseJSNode {
run() {
if (this.visitor.listeners[this.node.name]) {
const cb = this.visitor.listeners[this.node.name](this.node, this.visitor);
if (cb !== '__continue_exec') {
return cb;
}
}
if (this.visitor.scope.has(this.node.name))
return this.visitor.scope.get(this.node.name);
return this.node.name;
}
}