mirror of https://github.com/nodejs/node.git
buffer: remove unnecessary lazy loading
PR-URL: https://github.com/nodejs/node/pull/45807 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit is contained in:
parent
74a6f0bd07
commit
6cef4a6b5d
|
@ -30,6 +30,7 @@ const {
|
|||
TextDecoder,
|
||||
TextEncoder,
|
||||
} = require('internal/encoding');
|
||||
const { URL } = require('internal/url');
|
||||
|
||||
const {
|
||||
makeTransferable,
|
||||
|
@ -77,7 +78,6 @@ const kMaxChunkSize = 65536;
|
|||
const disallowedTypeCharacters = /[^\u{0020}-\u{007E}]/u;
|
||||
|
||||
let ReadableStream;
|
||||
let URL;
|
||||
|
||||
const enc = new TextEncoder();
|
||||
let dec;
|
||||
|
@ -86,11 +86,6 @@ let dec;
|
|||
// references between the url, internal/blob, and buffer
|
||||
// modules, lazy loading here makes sure that things work.
|
||||
|
||||
function lazyURL(id) {
|
||||
URL ??= require('internal/url').URL;
|
||||
return new URL(id);
|
||||
}
|
||||
|
||||
function lazyReadableStream(options) {
|
||||
// eslint-disable-next-line no-global-assign
|
||||
ReadableStream ??=
|
||||
|
@ -378,7 +373,7 @@ ObjectDefineProperties(Blob.prototype, {
|
|||
function resolveObjectURL(url) {
|
||||
url = `${url}`;
|
||||
try {
|
||||
const parsed = new lazyURL(url);
|
||||
const parsed = new URL(url);
|
||||
|
||||
const split = StringPrototypeSplit(parsed.pathname, ':');
|
||||
|
||||
|
|
Loading…
Reference in New Issue