Reduce "return undefined" or "return void 0" to simply "return".

@return The original node, maybe simplified.
960660
private Node tryReduceReturn(Node n) {
    Node result = n.getFirstChild();

    if (result != null) {
      switch (result.getToken()) {
        case VOID:
          Node operand = result.getFirstChild();
          if (!mayHaveSideEffects(operand)) {
            n.removeFirstChild();
            reportChangeToEnclosingScope(n);
          }
          break;
        case NAME:
          String name = result.getString();
          if (name.equals("undefined")) {
            n.removeFirstChild();
            reportChangeToEnclosingScope(n);
          }
          break;
        default:
          break;
      }
    }

    return n;
  }
36008
function reduceZeroDividedByAnything(node) {
  if (node.op !== '/') {
    return Node.Status.noChange(node);
  }
  if (node.args[0].value === '0') {
    const newNode = Node.Creator.constant(0);
    return Node.Status.nodeChanged(
      ChangeTypes.REDUCE_ZERO_NUMERATOR, node, newNode);
  }
  else {
    return Node.Status.noChange(node);
  }
}
193078
function() {
    var node = this.primary();
    if (node) {
      while (this.accept('.')) {
        var id = new nodes.Ident(this.expect('ident').val.string);
        node = new nodes.Member(node, id);
      }
      this.skipSpaces();
      if (this.accept('=')) {
        node.val = this.list();
        // @block support
        if (node.val.isEmpty) this.assignAtblock(node.val);
      }
    }
    return node;
  }
1145345
function() {
      var node = this.startNode(_IfStatement);
      this.expect('if');
      this.expect('(');

      var expr = this.parseExpression(true);
      this.expect(')');
      var consequent = this.parseStatement();
      var alternate = null;

      if (this.value === 'else') {
        this.next();
        alternate = this.parseStatement();
      }

      node.test = expr;
      node.consequent = consequent;
      node.alternate = alternate;
      return this.finishNode(node);
    }
962151
function () {
            var childNodes = this.nodes();
            if (childNodes.length < 1) {
                return null;
            }
            var elementValue = '';
            for (var i = 0; i < childNodes.length; i++) {
                var node = childNodes[i];
                var valueToAdd;
                if (!TypeUtils.isNullOrUndefined(node.value)) {
                    valueToAdd = node.value;
                }
                else {
                    valueToAdd = node.toString();
                }
                if (!TypeUtils.isNullOrUndefined(valueToAdd)) {
                    elementValue += valueToAdd;
                }
            }
            return elementValue;
        }
477851
function () {
                var a, b;

                if (! peek(/^[@\w.%-]+\/[@\w.-]+/)) return;

                save();

                if ((a = $(this.entity)) && $('/') && (b = $(this.entity))) {
                    return new(tree.Shorthand)(a, b);
                }

                restore();
            }
958610
public Val end(Val returning) {
    sanity_check_refs(returning);
    // Remove all temp frames
    Futures fs = new Futures();
    for (Frame fr : FRAMES.values()) {
      fs = downRefCnt(fr, fs);   // Remove internal Vecs one by one
      DKV.remove(fr._key, fs);   // Shallow remove, internal Vecs removed 1-by-1
    }
    fs.blockForPending();
    FRAMES.clear();             // No more temp frames
    // Copy (as needed) so the returning Frame is completely independent of the
    // (disappearing) session.
    if (returning != null && returning.isFrame()) {
      Frame fr = returning.getFrame();
      Key<Vec>[] vecs = fr.keys();
      for (int i = 0; i < vecs.length; i++) {
        _addRefCnt(vecs[i], -1); // Returning frame has refcnt +1, lower it now; should go to zero internal refcnts.
        if (GLOBALS.contains(vecs[i])) // Copy if shared with globals
          fr.replace(i, vecs[i].get().makeCopy());
      }
    }
    GLOBALS.clear();            // No longer tracking globals
    sanity_check_refs(null);
    REFCNTS.clear();
    return returning;
  }
696163
function(o) {
		var undef;

		if (o === undef) {
			return 'undefined';
		} else if (o === null) {
			return 'null';
		} else if (o.nodeType) {
			return 'node';
		}

		// the snippet below is awesome, however it fails to detect null, undefined and arguments types in IE lte 8
		return ({}).toString.call(o).match(/\s([a-z|A-Z]+)/)[1].toLowerCase();
	}
1134953
function getEnclosingFunction(node) {
    while  (node.type !== 'FunctionDeclaration' && 
            node.type !== 'FunctionExpression' && 
            node.type !== 'Program') {
        node = node.$parent;
    }
    return node;
}
1335465
static boolean isDirectCallNodeReplacementPossible(Node fnNode) {
    // Only inline single-statement functions
    Node block = NodeUtil.getFunctionBody(fnNode);

    // Check if this function is suitable for direct replacement of a CALL node:
    // a function that consists of single return that returns an expression.
    if (!block.hasChildren()) {
      // special case empty functions.
      return true;
    } else if (block.hasOneChild()) {
      // Only inline functions that return something.
      if (block.getFirstChild().isReturn()
          && block.getFirstFirstChild() != null) {
        return true;
      }
    }

    return false;
  }
1196709
public static Node newUndefinedNode(Node srcReferenceNode) {
    Node node = IR.voidNode(IR.number(0));
    if (srcReferenceNode != null) {
      node.useSourceInfoFromForTree(srcReferenceNode);
    }
    return node;
  }
1278504
function (node) {
            var first = node, length = 1;
            if (node.nodeType == 11) {
                first = node.firstChild;
                length = node.childNodes.length;
            }
            this.trimBoundary(true);
            var start = this.startContainer,
                offset = this.startOffset;
            var nextNode = start.childNodes[ offset ];
            if (nextNode) {
                start.insertBefore(node, nextNode);
            } else {
                start.appendChild(node);
            }
            if (first.parentNode === this.endContainer) {
                this.endOffset = this.endOffset + length;
            }
            return this.setStartBefore(first);
        }
352333
private Node defaultValueHook(Node getprop, Node defaultValue) {
    Node undefined = astFactory.createName("undefined", JSTypeNative.VOID_TYPE);
    undefined.makeNonIndexable();
    Node getpropClone = getprop.cloneTree().setJSType(getprop.getJSType());
    return astFactory.createHook(
        astFactory.createSheq(getprop, undefined), defaultValue, getpropClone);
  }
658099
Node createThisForFunction(Node functionNode) {
    final Node result = IR.thisNode();
    if (isAddingTypes()) {
      result.setJSType(getTypeOfThisForFunctionNode(functionNode));
    }
    return result;
  }
749404
function () {
      let scope = context.getScope();
      while (scope && scope.type !== 'class') {
        scope = scope.upper;
      }
      const node = scope && scope.block;
      if (!node || !utils.isES6Component(node)) {
        return null;
      }
      return node;
    }
756210
function getLineNumberOfTokenBefore(node) {
            const tokenBefore = sourceCode.getTokenBefore(node);
            let lineNumTokenBefore;

            /**
             * Global return (at the beginning of a script) is a special case.
             * If there is no token before `return`, then we expect no line
             * break before the return. Comments are allowed to occupy lines
             * before the global return, just no blank lines.
             * Setting lineNumTokenBefore to zero in that case results in the
             * desired behavior.
             */
            if (tokenBefore) {
                lineNumTokenBefore = tokenBefore.loc.end.line;
            } else {
                lineNumTokenBefore = 0; // global return at beginning of script
            }

            return lineNumTokenBefore;
        }
589716
private function _return() {
    $node = new ReturnStatementNode();
    $this->mustMatch(T_RETURN, $node);
    if ($this->tryMatch(';', $node, NULL, TRUE, TRUE) || $this->currentType === T_CLOSE_TAG) {
      return $node;
    }
    $node->addChild($this->expr(), 'expression');
    $this->endStatement($node);
    return $node;
  }