()
| 295 | function bodyMixinMethods (instance, getInternalState) { |
| 296 | const methods = { |
| 297 | blob () { |
| 298 | // The blob() method steps are to return the result of |
| 299 | // running consume body with this and the following step |
| 300 | // given a byte sequence bytes: return a Blob whose |
| 301 | // contents are bytes and whose type attribute is this’s |
| 302 | // MIME type. |
| 303 | return consumeBody(this, (bytes) => { |
| 304 | let mimeType = bodyMimeType(getInternalState(this)) |
| 305 | |
| 306 | if (mimeType === null) { |
| 307 | mimeType = '' |
| 308 | } else if (mimeType) { |
| 309 | mimeType = serializeAMimeType(mimeType) |
| 310 | } |
| 311 | |
| 312 | // Return a Blob whose contents are bytes and type attribute |
| 313 | // is mimeType. |
| 314 | return new Blob([bytes], { type: mimeType }) |
| 315 | }, instance, getInternalState) |
| 316 | }, |
| 317 | |
| 318 | arrayBuffer () { |
| 319 | // The arrayBuffer() method steps are to return the result |
nothing calls this directly
no test coverage detected