function addMessage(opt_data) {
    if (parser.depth_ > 1) {
      return;
    }

    goog.asserts.assert(opt_data !== '');  // '' not possible

    if (!opt_data) {
      // `input` must be a string here.
      if (msgStart === -1) {
        opt_data = parser.buffer_ +
            /** @type {string} */ (input).substring(streamStart, i);
      } else {
        opt_data = /** @type {string} */ (input).substring(msgStart, i);
      }
    }

    if (parser.deliverMessageAsRawString_) {
      parser.result_.push(opt_data);
    } else {
      parser.result_.push(
          goog.asserts.assertInstanceof(JSON.parse(opt_data), Object));
    }
    msgStart = i;
  }
@param {(string)=} opt_data The message to add