14 lines
494 B
JavaScript
14 lines
494 B
JavaScript
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;
|
|
}
|
|
}
|