(data, init = void 0)
| 12024 | } |
| 12025 | // https://fetch.spec.whatwg.org/#dom-response-json |
| 12026 | static json(data, init = void 0) { |
| 12027 | webidl.argumentLengthCheck(arguments, 1, "Response.json"); |
| 12028 | if (init !== null) { |
| 12029 | init = webidl.converters.ResponseInit(init); |
| 12030 | } |
| 12031 | const bytes = textEncoder.encode( |
| 12032 | serializeJavascriptValueToJSONString(data) |
| 12033 | ); |
| 12034 | const body = extractBody(bytes); |
| 12035 | const responseObject = fromInnerResponse(makeResponse({}), "response"); |
| 12036 | initializeResponse(responseObject, init, { body: body[0], type: "application/json" }); |
| 12037 | return responseObject; |
| 12038 | } |
| 12039 | // Creates a redirect Response that redirects to url with status status. |
| 12040 | static redirect(url, status = 302) { |
| 12041 | webidl.argumentLengthCheck(arguments, 1, "Response.redirect"); |
nothing calls this directly
no test coverage detected