We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc4398c commit 3389a5eCopy full SHA for 3389a5e
1 file changed
lib/internal/blob.js
@@ -78,6 +78,7 @@ let ReadableStream;
78
let URL;
79
80
const enc = new TextEncoder();
81
+let dec;
82
83
// Yes, lazy loading is annoying but because of circular
84
// references between the url, internal/blob, and buffer
@@ -311,7 +312,8 @@ class Blob {
311
312
if (!isBlob(this))
313
throw new ERR_INVALID_THIS('Blob');
314
- const dec = new TextDecoder();
315
+ dec ??= new TextDecoder();
316
+
317
return dec.decode(await this.arrayBuffer());
318
}
319
0 commit comments