How to use the isBinaryExpression function from @babel/types
Find comprehensive JavaScript @babel/types.isBinaryExpression code examples handpicked from public code repositorys.
GitHub: lk-li/spider_reverse
145 146 147 148 149 150 151 152 153 154
} } function add_Mem_str(path) { let node = path.node; if (node.computed && t.isBinaryExpression(node.property) && node.property.operator == '+') { let BinNode = node.property;//属性节点 let tmpast = parse.parse(generator(BinNode).code); let addstr = ''; traverse(tmpast, {
54
86
6
+ 7 other calls in file
180 181 182 183 184 185 186 187 188 189
const node_ = path_.node; if ( node_.argument && t.isSequenceExpression(node_.argument) && t.isAssignmentExpression(node_.argument.expressions[0]) && t.isBinaryExpression(node_.argument.expressions[0].right) && node_.argument.expressions[0].right.operator === '-' && !isNaN(node_.argument.expressions[0].right.right.value) ) { offset = node_.argument.expressions[0].right.right.value;
5
15
1
+ 63 other calls in file
84 85 86 87 88 89 90 91 92 93
} }) } } else if ( t.isArrayExpression(path.node.init) ){ // No handling for arrays right now } else if ( t.isBinaryExpression(path.node.init) ){ // No handling for ^^ right now } else if ( t.isFunctionExpression(path.node.init) ){ // No handling for ^^ right now } else if ( t.isUnaryExpression(path.node.init) ){
1
6
7
507 508 509 510 511 512 513 514 515 516
let parentPath = path.parentPath if (t.isIfStatement(parentPath) || t.isLogicalExpression(parentPath)) { let left = path.get("left") let right = path.get("right") if (t.isBinaryExpression(left) && t.isBinaryExpression(right)) { mergeBinaryExpression(path) } else { if (t.isLogicalExpression(left)) { mergeBinaryExpression(left)
220
0
0
85 86 87 88 89 90 91 92 93 94 95
expressionStatement: true }); } function Binary(node, parent) { if (node.operator === "**" && t.isBinaryExpression(parent, { operator: "**" })) { return parent.left === node; }
0
0
0
+ 5 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)