Skip to content

Commit 49840d4

Browse files
aduh95targos
authored andcommitted
buffer: remove unnecessary lazy loading
PR-URL: #45807 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
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

Lines changed: 2 additions & 7 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy