MCPcopy Create free account
hub / github.com/ampproject/amphtml / constructor

Method constructor

third_party/subscriptions-project/swg.js:13612–13630  ·  view source on GitHub ↗

* @param {!XMLHttpRequest} xhr

(xhr)

Source from the content-addressed store, hash-verified

13610 * @param {!XMLHttpRequest} xhr
13611 */
13612 constructor(xhr) {
13613 /** @private @const {!XMLHttpRequest} */
13614 this.xhr_ = xhr;
13615
13616 /** @const {number} */
13617 this.status = this.xhr_.status;
13618
13619 /** @const {boolean} */
13620 this.ok = this.status >= 200 && this.status < 300;
13621
13622 /** @const {!FetchResponseHeaders} */
13623 this.headers = new FetchResponseHeaders(xhr);
13624
13625 /** @type {boolean} */
13626 this.bodyUsed = false;
13627
13628 /** @type {?ReadableStream} */
13629 this.body = null;
13630 }
13631
13632 /**
13633 * Create a copy of the response and return it.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected