code: private static Node buildResultExpression(Node expr, boolean needResult, String tempName) {
      if (needResult) {
        JSType type = expr.getJSType();
        return withType(IR.assign(withType(IR.name(tempName), type), expr), type).srcrefTree(expr);
      } else {
        return expr;
      }
    }
docs: Create an expression tree for an expression.
  
  <p>If the result of the expression is needed, then:
  
  <pre>
  ASSIGN
  tempName
  expr
  </pre>
  
  otherwise, simply: `expr`