code: private Node tryRewriteStringValueOfCall(Node n) {
      Node param = n.getSecondChild();
      if (NodeUtil.isUndefined(param)) {
        return IR.string("null");
      } else if (NodeUtil.isDefinedValue(param) && !param.isArrayLit()) {
        // Generate String(param), let other peephole optimizations handle the rest when safe
        return NodeUtil.newCallNode(IR.name("String").useSourceInfoFrom(n), param.detach());
      }
      return n;
    }
docs: /*
  Cases to rewrite:
  String.valueOf("foo") -> String("foo")
  String.valueOf(null) -> String("null")
  String.valueOf(undefined) -> "null"
  String.valueOf("foo" + bar) -> String("foo" + bar)
  String.valueOf(bar + "foo") -> String(bar + "foo")
  String.valueOf("foo" + String.valueOf(bar)) -> String("foo" + String.valueOf(bar))