message: feat(utils): Kill some dead code branches in XHR instrumentation
diff: @@ -226,15 +226,15 @@ function instrumentXHR(): void {
  // eslint-disable-next-line @typescript-eslint/no-this-alias
  const xhr = this;
  const url = args[1];
  - xhr.__sentry_xhr__ = {
  + const xhrInfo: SentryWrappedXMLHttpRequest['__sentry_xhr__'] = (xhr.__sentry_xhr__ = {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
  method: isString(args[0]) ? args[0].toUpperCase() : args[0],
  url: args[1],
  - };
  + });
  // if Sentry key appears in URL, don't capture it as a request
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
  - if (isString(url) && xhr.__sentry_xhr__.method === 'POST' && url.match(/sentry_key/)) {
  + if (isString(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) {
  xhr.__sentry_own_request__ = true;
  }
  @@ -243,9 +243,7 @@ function instrumentXHR(): void {
  try {
  // touching statusCode in some platforms throws
  // an exception
  - if (xhr.__sentry_xhr__) {
  - xhr.__sentry_xhr__.status_code = xhr.status;
  - }
  + xhrInfo.status_code = xhr.status;
  } catch (e) {
  /* do nothing */
  }
  @@ -256,8 +254,8 @@ function instrumentXHR(): void {
  // Make sure to pop both key and value to keep it in sync.
  requestKeys.splice(requestPos);
  const args = requestValues.splice(requestPos)[0];
  - if (xhr.__sentry_xhr__ && args[0] !== undefined) {
  - xhr.__sentry_xhr__.body = args[0] as XHRSendInput;
  + if (args[0] !== undefined) {
  + xhrInfo.body = args[0] as XHRSendInput;
  }
  }
  } catch (e) {
  