diff --git a/lib/internal/webstreams/readablestream.js b/lib/internal/webstreams/readablestream.js index 2369175733c115..abdfb9d72b720d 100644 --- a/lib/internal/webstreams/readablestream.js +++ b/lib/internal/webstreams/readablestream.js @@ -371,10 +371,7 @@ class ReadableStream { // The web platform tests require that these be handled one at a // time and in a specific order. options can be null or undefined. validateObject(options, 'options', kValidateObjectAllowObjectsAndNull); - const preventAbort = options?.preventAbort; - const preventCancel = options?.preventCancel; - const preventClose = options?.preventClose; - const signal = options?.signal; + const { preventAbort, preventCancel, preventClose, signal } = options; if (signal !== undefined) { validateAbortSignal(signal, 'options.signal'); @@ -414,10 +411,7 @@ class ReadableStream { } validateObject(options, 'options', kValidateObjectAllowObjectsAndNull); - const preventAbort = options?.preventAbort; - const preventCancel = options?.preventCancel; - const preventClose = options?.preventClose; - const signal = options?.signal; + const { preventAbort, preventCancel, preventClose, signal } = options; if (signal !== undefined) { validateAbortSignal(signal, 'options.signal');