How to use the VisitorOption function from estraverse

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

25
26
27
28
29
30
31
32
33
34
                    parentCollection = [parentCollection];
                }
            }

            if (cb(node, parent, parentCollection) === false) {
                return estraverse.VisitorOption.Skip;
            }
        }
    });
}
fork icon549
star icon0
watch icon2

98
99
100
101
102
103
104
105
106
107

    // TODO TODO TODO TODO TODO TODO
    if (node.type == 'FunctionDeclaration') {
        // TODO TODO TODO TODO TODO TODO
        if (node.id.name == '_functionEnter' || node.id.name == '_functionExit' || node.id.name == '_functionEnter_callback')
            return estraverse.VisitorOption.Skip; //////////////// TODO TODO TODO ?????????????

        name = node.id.name;
//                                      console.log('***** DEC: ', name);
    }
fork icon2
star icon8
watch icon17

8
9
10
11
12
13
14
15
16
17
estraverse.traverse(AST, {
    enter: function (node, parent) {
        if (node.type == 'Literal') {
            if (node.value === fileName) {
                charPos = node.start;
                return estraverse.VisitorOption.Break;
            }
        }
    }
});
fork icon3
star icon2
watch icon8

+ 5 other calls in file

10
11
12
13
14
15
16
17
18
19
estraverse.traverse(ast, {
  enter: function (node, parent) {
    if (predicate(node)) {
      results.push(dataExtractor(node))

      return estraverse.VisitorOption.Skip
    }
  }
})
return results
fork icon483
star icon0
watch icon123

19
20
21
22
23
24
25
26
27
28
  , typeofHelper = require('./typeof')
  , hoistinator = require('./hoistinator')
  ;

// Ease of use...
var SKIP = estraverse.VisitorOption.Skip;
var BREAK = estraverse.VisitorOption.Break;

// If behavior is required on a node, it goes here
var nodeHandlers = {};
fork icon1
star icon0
watch icon2

+ 3 other calls in file

22
23
24
25
26
27
28
    });
}

module.exports = {
    traverse,
    VisitorOption: estraverse.VisitorOption
};
fork icon0
star icon21
watch icon3

+ 3 other calls in file