code: private Node getNewValueNode(JsMessage message, Node origValueNode)
        throws MalformedException {
      switch (origValueNode.getToken()) {
        case FUNCTION:
          // The message is a function. Modify the function node.
          updateFunctionNode(message, origValueNode);
          return origValueNode;
        case STRING:
          // The message is a simple string. Modify the string node.
          String newString = message.toString();
          if (!origValueNode.getString().equals(newString)) {
            origValueNode.setString(newString);
            compiler.reportChangeToEnclosingScope(origValueNode);
          }
          return origValueNode;
        case ADD:
          // The message is a simple string. Create a string node.
          return IR.string(message.toString());
        case CALL:
          // The message is a function call. Replace it with a string expression.
          return replaceCallNode(message, origValueNode);
        default:
          throw new MalformedException(
              "Expected FUNCTION, STRING, or ADD node; found: " + origValueNode.getToken(),
              origValueNode);
      }
    }
docs: Constructs a node representing a message's value, or, if possible, just
  modifies {@code origValueNode} so that it accurately represents the
  message's value.
  
  @param message  a message
  @param origValueNode  the message's original value node
  @return a Node that can replace {@code origValueNode}
  
  @throws MalformedException if the passed node's subtree structure is
  not as expected