lib/optimiser.js
function findVariableReferences (ast, identifier, skip) {
  var references = [];
  traverse.traverse(ast, {
    enter: function (node, parent) {
      if (node === skip) {
        this.skip();
      }
      else if (
          node.type === 'Identifier' &&
          node.name === identifier.name &&
          (parent.type !== 'MemberExpression' || parent.left !== node)
      ) {
        references.push(node);
      }
    }
  });
  return references;
}
function findVariableReferences (ast, identifier, skip) {
  var references = [];
  traverse.traverse(ast, {
    enter: function (node, parent) {
      if (node === skip) {
        this.skip();
      }
      else if (
          node.type === 'Identifier' &&
          node.name === identifier.name &&
          (parent.type !== 'MemberExpression' || parent.left !== node)
      ) {
        references.push(node);
      }
    }
  });
  return references;
}
function findVariableReferences ( ast , identifier , skip ) { var references = [ ] ; traverse . traverse ( ast , { enter : function ( node , parent ) { if ( node === skip ) { this . skip ( ) ; } else if ( node . type === 'Identifier' && node . name === identifier . name && ( parent . type !== 'MemberExpression' || parent . left !== node ) ) { references . push ( node ) ; } } } ) ; return references ; }
Find references to a given identifier
Find references to a given identifier