How to use the esprima-fb.Syntax.MemberExpression function in esprima-fb

To help you get started, we’ve selected a few esprima-fb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebookarchive / jstransform / visitors / es6-template-visitors.js View on Github external
// those cases.
      if (ii === 0) {
        utils.append('"" + ', state);
      }
      if (ii > 0 && !templateElement.tail) {
        // + between substitution and substitution
        utils.append(' + ', state);
      }
    }

    utils.move(templateElement.range[1], state);
    if (!templateElement.tail) {
      var substitution = node.expressions[ii];
      if (substitution.type === Syntax.Identifier ||
          substitution.type === Syntax.Literal ||
          substitution.type === Syntax.MemberExpression ||
          substitution.type === Syntax.CallExpression) {
        utils.catchup(substitution.range[1], state);
      } else {
        utils.append('(', state);
        traverse(substitution, path, state);
        utils.catchup(substitution.range[1], state);
        utils.append(')', state);
      }
      // if next templateElement isn't empty...
      if (templateElements[ii + 1].value.cooked !== '') {
        utils.append(' + ', state);
      }
    }
  }
  utils.move(node.range[1], state);
  utils.append(')', state);
github Lapple / ErrorBoard / node_modules / react-tools / node_modules / jstransform / visitors / es6-class-visitors.js View on Github external
visitPrivateIdentifier.test = function(node, path, state) {
  if (node.type === Syntax.Identifier && _shouldMungeIdentifier(node, state)) {
    // Always munge non-computed properties of MemberExpressions
    // (a la preventing access of properties of unowned objects)
    if (path[0].type === Syntax.MemberExpression && path[0].object !== node
        && path[0].computed === false) {
      return true;
    }

    // Always munge identifiers that were declared within the method function
    // scope
    if (utils.identWithinLexicalScope(node.name, state, state.methodFuncNode)) {
      return true;
    }

    // Always munge private keys on object literals defined within a method's
    // scope.
    if (path[0].type === Syntax.Property
        && path[1].type === Syntax.ObjectExpression) {
      return true;
    }
github facebookarchive / jstransform / visitors / undefined-to-void-0-visitors.js View on Github external
case Syntax.ArrowFunctionExpression:
          // skips: function params
          if (node !== path[0].body) {
            return false;
          }
          break;
        case Syntax.AssignmentExpression:
          // throws for: `undefined = foo` (where `undefined` is not declared)
          if (node === path[0].left) {
            throw new Error(
              'Illegal assignment to `undefined`. '
                + 'This breaks assumptions of the transform.'
            );
          }
          break;
        case Syntax.MemberExpression:
          // skips: `foo.undefined` but not `foo[undefined]`
          if (node === path[0].property && !path[0].computed) {
            return false;
          }
          break;
        case Syntax.VariableDeclarator:
          // skips: `var undefined`
          if (node !== path[0].init) {
            return false;
          }
          break;
        case Syntax.Property:
          // skips: `undefined: foo`
          if (node === path[0].key) {
            return false;
          }
github bosonic / bosonic / tools / transpiler / visitors / super_call_expressions.js View on Github external
visitSuperCallExpression.test = function(node, path, state) {
    if (node.type === Syntax.CallExpression) {
        var callee = node.callee;
        if (callee.type === Syntax.Identifier && callee.name === 'super'
            || callee.type == Syntax.MemberExpression
            && callee.object.name === 'super') {
            return true;
        }
    }
    return false;
};
github Caltech-IPAC / firefly / node_modules / react / node_modules / envify / node_modules / jstransform / visitors / reserved-words-visitors.js View on Github external
visitMemberExpression.test = function(node) {
  return node.type === Syntax.MemberExpression &&
    node.property.type === Syntax.Identifier &&
    reserverdWordsHelper.isES3ReservedWord(node.property.name);
};
github facebookarchive / jstransform / visitors / reserved-words-visitors.js View on Github external
visitMemberExpression.test = function(node) {
  return node.type === Syntax.MemberExpression &&
    node.property.type === Syntax.Identifier &&
    reserverdWordsHelper.isES3ReservedWord(node.property.name);
};
github guptag / FinCharts / app / node_modules / react / node_modules / envify / node_modules / jstransform / visitors / es6-class-visitors.js View on Github external
visitSuperCallExpression.test = function(node, path, state) {
  if (state.superClass && node.type === Syntax.CallExpression) {
    var callee = node.callee;
    if (callee.type === Syntax.Identifier && callee.name === 'super'
        || callee.type == Syntax.MemberExpression
           && callee.object.name === 'super') {
      return true;
    }
  }
  return false;
};
github bosonic / bosonic / tools / transpiler / visitors / register_expressions.js View on Github external
visitRegisterExpression.test = function(node, path, state) {
    return (node.type === Syntax.ExpressionStatement && node.expression.type === Syntax.ObjectExpression)
        || (node.type === Syntax.CallExpression
            && node.callee.type === Syntax.MemberExpression && node.callee.object.name === 'Bosonic'
            && node.callee.property.name === 'register'
            && node.arguments[0].type === Syntax.ObjectExpression);
};
github facebookarchive / jstransform / visitors / react-display-name-visitors.js View on Github external
function flattenIdentifierOrMemberExpression(expr) {
  if (expr.type === Syntax.Identifier) {
    return [expr.name];
  } else if (expr.type === Syntax.MemberExpression) {
    if (!expr.computed && expr.property.type === Syntax.Identifier) {
      var flattenedObject = flattenIdentifierOrMemberExpression(expr.object);
      if (flattenedObject) {
        flattenedObject.push(expr.property.name);
        return flattenedObject;
      } else {
        return [expr.property.name];
      }
    }
  }
  return null;
}
github Lapple / ErrorBoard / node_modules / react-tools / node_modules / jstransform / visitors / es6-class-visitors.js View on Github external
visitSuperMemberExpression.test = function(node, path, state) {
  return state.superClass
         && node.type === Syntax.MemberExpression
         && node.object.type === Syntax.Identifier
         && node.object.name === 'super';
};