[whatwg/fetch] Allow used body replacement in Request constructor (#675)

Currently, the following code snippet replaces `request`'s body as one would expect:

```javascript
let request = new Request(url, { method: "POST", body: "foo" })
request = new Request(request, { body: "bar" })
```

But this snippet throws a TypeError early in Request's constructor:

```javascript
let request = new Request(url, { method: "POST", body: "foo" })
await request.text()  // disturb the body
request = new Request(request, { body: "bar" })  // throws
```

This commit's changes allows the latter code snippet to work like the first one.

Fixes #674.
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/fetch/pull/675

-- Commit Summary --

  * Allow used body replacement in Request constructor

-- File Changes --

    M fetch.bs (16)

-- Patch Links --

https://github.com/whatwg/fetch/pull/675.patch
https://github.com/whatwg/fetch/pull/675.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/675

Received on Wednesday, 28 February 2018 18:23:39 UTC