From 9505a3730cb255efc0de31f7dad682940f88cc84 Mon Sep 17 00:00:00 2001 From: Khafra Date: Mon, 26 Jun 2023 14:18:26 -0400 Subject: [PATCH] fix: update spec text --- lib/fetch/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/fetch/index.js b/lib/fetch/index.js index 10c71d06067..f69371a941d 100644 --- a/lib/fetch/index.js +++ b/lib/fetch/index.js @@ -180,14 +180,15 @@ async function fetch (input, init = {}) { // 1. Set locallyAborted to true. locallyAborted = true - // 2. Abort the fetch() call with p, request, responseObject, + // 2. Assert: controller is non-null. + assert(controller != null) + + // 3. Abort controller with requestObject’s signal’s abort reason. + controller.abort(requestObject.signal.reason) + + // 4. Abort the fetch() call with p, request, responseObject, // and requestObject’s signal’s abort reason. abortFetch(p, request, responseObject, requestObject.signal.reason) - - // 3. If controller is not null, then abort controller. - if (controller != null) { - controller.abort(requestObject.signal.reason) - } }, { once: true } )