How to use the traverse function from @babel/core
Find comprehensive JavaScript @babel/core.traverse code examples handpicked from public code repositorys.
204 205 206 207 208 209 210 211 212 213
// presets: ['@babel/preset-env', '@babel/preset-react'], // parserOpts: { // } }); traverse(ast, updateVariable, undefined, [ { ...ctx, path: null, },
6
19
36
+ 11 other calls in file
97 98 99 100 101 102 103 104 105 106
if (!nodeHadRemoveTS.ast) { return; } babel.traverse(nodeHadRemoveTS.ast, { enter(p) { let value = ""; if (p.isImportDeclaration()) {
3
20
2
+ 5 other calls in file
GitHub: lionche/jitfunfuzz
12 13 14 15 16 17 18 19 20 21 22 23 24
let returnState = '' //输出所有定义的变量和对应的类型 babel.traverse(ast, { enter(path) { if (path.node.type === "FunctionDeclaration" && path.node.id.name === "fuzzopt") { //方法内部 let funcbody = path.node.body.body
0
1
1
+ 11 other calls in file
115 116 117 118 119 120 121 122 123 124 125 126 127
path.skipKey("body"); } }); const nestedVisitor = _core.traverse.visitors.merge([Object.assign({}, visitor), _helperEnvironmentVisitor.default]); return privateNameVisitor; }
0
0
1
+ 7 other calls in file
67 68 69 70 71 72 73 74 75
const setState = newState => { Object.assign(classState, newState); }; const findThisesVisitor = _core.traverse.visitors.merge([_helperReplaceSupers.environmentVisitor, { ThisExpression(path) { classState.superThises.push(path); }
0
0
1
+ 3 other calls in file
@babel/core.types is the most popular function in @babel/core (2111 examples)