Skip to content

Commit 49840d4

Browse files
aduh95targos
authored andcommitted
buffer: remove unnecessary lazy loading
PR-URL: #45807 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
1 parent 349b4f8 commit 49840d4

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/internal/blob.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const {
3030
TextDecoder,
3131
TextEncoder,
3232
} = require('internal/encoding');
33+
const { URL } = require('internal/url');
3334

3435
const {
3536
makeTransferable,
@@ -77,7 +78,6 @@ const kMaxChunkSize = 65536;
7778
const disallowedTypeCharacters = /[^\u{0020}-\u{007E}]/u;
7879

7980
let ReadableStream;
80-
let URL;
8181

8282
const enc = new TextEncoder();
8383
let dec;
@@ -86,11 +86,6 @@ let dec;
8686
// references between the url, internal/blob, and buffer
8787
// modules, lazy loading here makes sure that things work.
8888

89-
function lazyURL(id) {
90-
URL ??= require('internal/url').URL;
91-
return new URL(id);
92-
}
93-
9489
function lazyReadableStream(options) {
9590
// eslint-disable-next-line no-global-assign
9691
ReadableStream ??=
@@ -378,7 +373,7 @@ ObjectDefineProperties(Blob.prototype, {
378373
function resolveObjectURL(url) {
379374
url = `${url}`;
380375
try {
381-
const parsed = new lazyURL(url);
376+
const parsed = new URL(url);
382377

383378
const split = StringPrototypeSplit(parsed.pathname, ':');
384379

0 commit comments

Comments
 (0)