code: private Node maybeReplaceChildWithNumber(Node n, Node parent, int num) {
      Node newNode = IR.number(num);
      if (!newNode.isEquivalentTo(n)) {
        parent.replaceChild(n, newNode);
        reportChangeToEnclosingScope(newNode);
        markFunctionsDeleted(n);
  
        return newNode;
      }
  
      return n;
    }
docs: Replaces a node with a number node if the new number node is not equivalent
  to the current node.
  
  Returns the replacement for n if it was replaced, otherwise returns n.