|
| 1 | +var xtend = require('xtend') |
1 | 2 | var walk = require('acorn/dist/walk')
|
2 | 3 |
|
3 |
| -module.exports = walk |
| 4 | +var base = xtend(walk.base, { |
| 5 | + Import: function () {}, |
| 6 | + // pending https://github.com/acornjs/acorn/pull/705 |
| 7 | + CatchClause: function (node, st, c) { |
| 8 | + if (node.param) c(node.param, st, 'Pattern') |
| 9 | + c(node.body, st, 'ScopeBody') |
| 10 | + } |
| 11 | +}) |
| 12 | + |
| 13 | +function simple (node, visitors, baseVisitor, state, override) { |
| 14 | + return walk.simple(node, visitors, baseVisitor || base, state, override) |
| 15 | +} |
| 16 | + |
| 17 | +function ancestor (node, visitors, baseVisitor, state) { |
| 18 | + return walk.ancestor(node, visitors, baseVisitor || base, state) |
| 19 | +} |
| 20 | + |
| 21 | +function recursive (node, state, funcs, baseVisitor, override) { |
| 22 | + return walk.recursive(node, state, funcs, baseVisitor || base, override) |
| 23 | +} |
| 24 | + |
| 25 | +function full (node, callback, baseVisitor, state, override) { |
| 26 | + return walk.full(node, callback, baseVisitor || base, state, override) |
| 27 | +} |
| 28 | + |
| 29 | +function fullAncestor (node, callback, baseVisitor, state) { |
| 30 | + return walk.fullAncestor(node, callback, baseVisitor || base, state) |
| 31 | +} |
| 32 | + |
| 33 | +function findNodeAt (node, start, end, test, baseVisitor, state) { |
| 34 | + return walk.findNodeAt(node, start, end, test, baseVisitor || base, state) |
| 35 | +} |
| 36 | + |
| 37 | +function findNodeAround (node, pos, test, baseVisitor, state) { |
| 38 | + return walk.findNodeAround(node, pos, test, baseVisitor || base, state) |
| 39 | +} |
| 40 | + |
| 41 | +function findNodeAfter (node, pos, test, baseVisitor, state) { |
| 42 | + return walk.findNodeAfter(node, pos, test, baseVisitor || base, state) |
| 43 | +} |
| 44 | + |
| 45 | +function findNodeBefore (node, pos, test, baseVisitor, state) { |
| 46 | + return walk.findNodeBefore(node, pos, test, baseVisitor || base, state) |
| 47 | +} |
| 48 | + |
| 49 | +function make (funcs, baseVisitor) { |
| 50 | + return walk.make(funcs, baseVisitor || base) |
| 51 | +} |
| 52 | + |
| 53 | +exports.simple = simple |
| 54 | +exports.ancestor = ancestor |
| 55 | +exports.recursive = recursive |
| 56 | +exports.full = full |
| 57 | +exports.fullAncestor = fullAncestor |
| 58 | +exports.findNodeAt = findNodeAt |
| 59 | +exports.findNodeAround = findNodeAround |
| 60 | +exports.findNodeAfter = findNodeAfter |
| 61 | +exports.findNodeBefore = findNodeBefore |
| 62 | +exports.make = make |
| 63 | +exports.base = base |
0 commit comments