({ tree: { Quoted }, visitors }, manager)
| 1 | module.exports = { |
| 2 | install({ tree: { Quoted }, visitors }, manager) { |
| 3 | class Visitor { |
| 4 | constructor() { |
| 5 | this.native = new visitors.Visitor(this); |
| 6 | |
| 7 | this.isPreEvalVisitor = true; |
| 8 | this.isReplacing = true; |
| 9 | } |
| 10 | |
| 11 | run(root) { |
| 12 | return this.native.visit(root); |
| 13 | } |
| 14 | |
| 15 | visitVariable(node) { |
| 16 | if (node.name === '@replace') { |
| 17 | return new Quoted(`'`, 'bar', true); |
| 18 | } |
| 19 | return node; |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | manager.addVisitor(new Visitor()); |
| 24 | // console.log(manager); |
| 25 | }, |
| 26 | minVersion: [2,0,0] |
| 27 | }; |
nothing calls this directly
no test coverage detected