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 b37eaa1Copy full SHA for b37eaa1
lib/internal/blob.js
@@ -78,6 +78,7 @@ let ReadableStream;
78
let URL;
79
80
const enc = new TextEncoder();
81
+let dec = undefined;
82
83
// Yes, lazy loading is annoying but because of circular
84
// references between the url, internal/blob, and buffer
@@ -311,7 +312,10 @@ class Blob {
311
312
if (!isBlob(this))
313
throw new ERR_INVALID_THIS('Blob');
314
- const dec = new TextDecoder();
315
+ if (dec === undefined) {
316
+ dec = new TextDecoder();
317
+ }
318
+
319
return dec.decode(await this.arrayBuffer());
320
}
321
0 commit comments