Skip to content

Commit

Permalink
fetch: prefer global over lazy loading (#1793)
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed Nov 30, 2022
1 parent 232905f commit 671e05f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/fetch/body.js
Expand Up @@ -16,8 +16,7 @@ const { File } = require('./file')
const { StringDecoder } = require('string_decoder')
const { parseMIMEType, serializeAMimeType } = require('./dataURL')

/** @type {globalThis['ReadableStream']} */
let ReadableStream
let ReadableStream = globalThis.ReadableStream

// https://fetch.spec.whatwg.org/#concept-bodyinit-extract
function extractBody (object, keepalive = false) {
Expand Down
3 changes: 1 addition & 2 deletions lib/fetch/index.js
Expand Up @@ -61,8 +61,7 @@ const { webidl } = require('./webidl')

/** @type {import('buffer').resolveObjectURL} */
let resolveObjectURL
/** @type {globalThis['ReadableStream']} */
let ReadableStream
let ReadableStream = globalThis.ReadableStream

const nodeVersion = process.versions.node.split('.')
const nodeMajor = Number(nodeVersion[0])
Expand Down
2 changes: 1 addition & 1 deletion lib/fetch/request.js
Expand Up @@ -29,7 +29,7 @@ const { URLSerializer } = require('./dataURL')
const { kHeadersList } = require('../core/symbols')
const assert = require('assert')

let TransformStream
let TransformStream = globalThis.TransformStream

const kInit = Symbol('init')

Expand Down

0 comments on commit 671e05f

Please sign in to comment.