How to use the isThisExpression function from babel-types
Find comprehensive JavaScript babel-types.isThisExpression code examples handpicked from public code repositorys.
GitHub: bluepeople1/mpx

37 38 39 40 41 42 43 44 45 46
enter (path) { const callee = path.node.callee const args = path.node.arguments if ( t.isMemberExpression(callee) && t.isThisExpression(callee.object) && (callee.property.name === '__travel' || callee.property.value === '__travel') && t.isBooleanLiteral(args[2]) && args[2].value === true ) {
+ 5 other calls in file
GitHub: yutiansut/mpx

34 35 36 37 38 39 40 41 42 43
let bindThisVisitor = { CallExpression: { enter (path) { let callee = path.node.callee if (t.isMemberExpression(callee) && t.isThisExpression(callee.object) && callee.property.name === '__checkIgnore') { hasIgnore = false } }, exit (path) {
+ 19 other calls in file
138 139 140 141 142 143 144 145 146 147
for (const statement of _.cloneDeep(method.body.body)) { if (t.isExpressionStatement(statement) && t.isAssignmentExpression(statement.expression)) { const expr = statement.expression; const { left, right } = expr; if (t.isMemberExpression(left) && t.isThisExpression(left.object) && t.isIdentifier(left.property)) { if ((t.isArrowFunctionExpression(right) || t.isFunctionExpression(right)) || (left.property.name === 'config' && t.isObjectExpression(right))) { body.push(t.classProperty(left.property, right));
+ 6 other calls in file
babel-types.identifier is the most popular function in babel-types (4076 examples)