(response, state)
| 405 | } |
| 406 | |
| 407 | function makeFilteredResponse (response, state) { |
| 408 | state = { |
| 409 | internalResponse: response, |
| 410 | ...state |
| 411 | } |
| 412 | |
| 413 | return new Proxy(response, { |
| 414 | get (target, p) { |
| 415 | return p in state ? state[p] : target[p] |
| 416 | }, |
| 417 | set (target, p, value) { |
| 418 | assert(!(p in state)) |
| 419 | target[p] = value |
| 420 | return true |
| 421 | } |
| 422 | }) |
| 423 | } |
| 424 | |
| 425 | // https://fetch.spec.whatwg.org/#concept-filtered-response |
| 426 | function filterResponse (response, type) { |