(body = null, init = void 0)
| 12058 | } |
| 12059 | // https://fetch.spec.whatwg.org/#dom-response |
| 12060 | constructor(body = null, init = void 0) { |
| 12061 | webidl.util.markAsUncloneable(this); |
| 12062 | if (body === kConstruct) { |
| 12063 | return; |
| 12064 | } |
| 12065 | if (body !== null) { |
| 12066 | body = webidl.converters.BodyInit(body, "Response", "body"); |
| 12067 | } |
| 12068 | init = webidl.converters.ResponseInit(init); |
| 12069 | this.#state = makeResponse({}); |
| 12070 | this.#headers = new Headers(kConstruct); |
| 12071 | setHeadersGuard(this.#headers, "response"); |
| 12072 | setHeadersList(this.#headers, this.#state.headersList); |
| 12073 | let bodyWithType = null; |
| 12074 | if (body != null) { |
| 12075 | const [extractedBody, type] = extractBody(body); |
| 12076 | bodyWithType = { body: extractedBody, type }; |
| 12077 | } |
| 12078 | initializeResponse(this, init, bodyWithType); |
| 12079 | } |
| 12080 | // Returns response?s type, e.g., "cors". |
| 12081 | get type() { |
| 12082 | webidl.brandCheck(this, _Response); |
nothing calls this directly
no test coverage detected