How to use the isThisExpression function from babel-types

Find comprehensive JavaScript babel-types.isThisExpression code examples handpicked from public code repositorys.

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
  ) {
fork icon349
star icon0
watch icon0

+ 5 other calls in file

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) {
fork icon349
star icon0
watch icon3

+ 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));
fork icon0
star icon0
watch icon0

+ 6 other calls in file

Other functions in babel-types

Sorted by popularity

function icon

babel-types.identifier is the most popular function in babel-types (4076 examples)