()
| 507 | } |
| 508 | |
| 509 | abort(): void { |
| 510 | this._aborted = true; |
| 511 | if (this._requestId) { |
| 512 | RCTNetworking.abortRequest(this._requestId); |
| 513 | } |
| 514 | // only call onreadystatechange if there is something to abort, |
| 515 | // below logic is per spec |
| 516 | if (!(this.readyState === this.UNSENT || |
| 517 | (this.readyState === this.OPENED && !this._sent) || |
| 518 | this.readyState === this.DONE)) { |
| 519 | this._reset(); |
| 520 | this.setReadyState(this.DONE); |
| 521 | } |
| 522 | // Reset again after, in case modified in handler |
| 523 | this._reset(); |
| 524 | } |
| 525 | |
| 526 | setResponseHeaders(responseHeaders: ?Object): void { |
| 527 | this.responseHeaders = responseHeaders || null; |
no test coverage detected