How to use the Controller function from estraverse

Find comprehensive JavaScript estraverse.Controller code examples handpicked from public code repositorys.

62
63
64
65
66
67
68
    traverse : estraverse.traverse,
    replace : estraverse.replace,
    attachComments : estraverse.attachComments,
    VisitorKeys : estraverse.VisitorKeys,
    VisitorOption : estraverse.VisitorOption,
    Controller : estraverse.Controller
};
fork icon2
star icon9
watch icon3

+ 3 other calls in file

47
48
49
50
51
52
53
54
55
56
 *
 * @param {Object} tree - esprima AST
 * @see {@link http://esprima.org/doc/#ast|esprima AST}
 */
annotate: function(tree) {
  var controller = new estraverse.Controller();
  controller.traverse(tree, {
    enter : function (node, parent) {
      node[annotateKey] = parent;
    }
fork icon258
star icon5
watch icon2