build/generateExterns.js
function getAllExpressionStatements(node) {
  console.assert(node.body && node.body.body);
  var expressionStatements = [];
  node.body.body.forEach(function(childNode) {
    if (childNode.type == 'ExpressionStatement') {
      expressionStatements.push(childNode);
    } else if (childNode.body) {
      var childExpressions = getAllExpressionStatements(childNode);
      expressionStatements.push.apply(expressionStatements, childExpressions);
    }
  });
  return expressionStatements;
}
function getAllExpressionStatements(node) {
  console.assert(node.body && node.body.body);
  var expressionStatements = [];
  node.body.body.forEach(function(childNode) {
    if (childNode.type == 'ExpressionStatement') {
      expressionStatements.push(childNode);
    } else if (childNode.body) {
      var childExpressions = getAllExpressionStatements(childNode);
      expressionStatements.push.apply(expressionStatements, childExpressions);
    }
  });
  return expressionStatements;
}
function getAllExpressionStatements ( node ) { console . assert ( node . body && node . body . body ) ; var expressionStatements = [ ] ; node . body . body . forEach ( function ( childNode ) { if ( childNode . type == 'ExpressionStatement' ) { expressionStatements . push ( childNode ) ; } else if ( childNode . body ) { var childExpressions = getAllExpressionStatements ( childNode ) ; expressionStatements . push . apply ( expressionStatements , childExpressions ) ; } } ) ; return expressionStatements ; }
Recursively find all expression statements in all block nodes.
@param {ASTNode} node
@return {!Array.<ASTNode>}
Recursively find all expression statements in all block nodes .