(object, convertBytesToJSValue, instance)
| 5853 | } |
| 5854 | function cloneBody(instance, body) { |
| 5855 | const [out1, out2] = body.stream.tee(); |
| 5856 | body.stream = out1; |
| 5857 | return { |
| 5858 | stream: out2, |
| 5859 | length: body.length, |
| 5860 | source: body.source |
| 5861 | }; |
| 5862 | } |
| 5863 | function throwIfAborted(state) { |
| 5864 | if (state.aborted) { |
| 5865 | throw new DOMException("The operation was aborted.", "AbortError"); |
| 5866 | } |
| 5867 | } |
| 5868 | function bodyMixinMethods(instance) { |
| 5869 | const methods = { |
| 5870 | blob() { |
| 5871 | return consumeBody(this, (bytes) => { |
| 5872 | let mimeType = bodyMimeType(this); |
| 5873 | if (mimeType === null) { |
| 5874 | mimeType = ""; |
| 5875 | } else if (mimeType) { |
| 5876 | mimeType = serializeAMimeType(mimeType); |
| 5877 | } |
| 5878 | return new Blob2([bytes], { type: mimeType }); |
| 5879 | }, instance); |
| 5880 | }, |
| 5881 | arrayBuffer() { |
no test coverage detected