Skip to content

Commit

Permalink
processBody doesn't need to return a promise (#2858)
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed Feb 27, 2024
1 parent 16e49ff commit 4090043
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/web/fetch/index.js
Expand Up @@ -204,7 +204,7 @@ function fetch (input, init = undefined) {
const processResponse = (response) => {
// 1. If locallyAborted is true, terminate these substeps.
if (locallyAborted) {
return Promise.resolve()
return
}

// 2. If response’s aborted flag is set, then:
Expand All @@ -217,14 +217,14 @@ function fetch (input, init = undefined) {
// deserializedError.

abortFetch(p, request, responseObject, controller.serializedAbortReason)
return Promise.resolve()
return
}

// 3. If response is a network error, then reject p with a TypeError
// and terminate these substeps.
if (response.type === 'error') {
p.reject(new TypeError('fetch failed', { cause: response.error }))
return Promise.resolve()
return
}

// 4. Set responseObject to the result of creating a Response object,
Expand Down

0 comments on commit 4090043

Please sign in to comment.