(newState: number)
| 534 | } |
| 535 | |
| 536 | setReadyState(newState: number): void { |
| 537 | this.readyState = newState; |
| 538 | this.dispatchEvent({type: 'readystatechange'}); |
| 539 | if (newState === this.DONE) { |
| 540 | if (this._aborted) { |
| 541 | this.dispatchEvent({type: 'abort'}); |
| 542 | } else if (this._hasError) { |
| 543 | if (this._timedOut) { |
| 544 | this.dispatchEvent({type: 'timeout'}); |
| 545 | } else { |
| 546 | this.dispatchEvent({type: 'error'}); |
| 547 | } |
| 548 | } else { |
| 549 | this.dispatchEvent({type: 'load'}); |
| 550 | } |
| 551 | this.dispatchEvent({type: 'loadend'}); |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | /* global EventListener */ |
| 556 | addEventListener(type: string, listener: EventListener): void { |
no test coverage detected