diff --git a/lib/internal/blob.js b/lib/internal/blob.js index 8014a1bb5b0349..15309b8886c01c 100644 --- a/lib/internal/blob.js +++ b/lib/internal/blob.js @@ -78,6 +78,7 @@ let ReadableStream; let URL; const enc = new TextEncoder(); +const dec = new TextDecoder(); // Yes, lazy loading is annoying but because of circular // references between the url, internal/blob, and buffer @@ -310,8 +311,6 @@ class Blob { async text() { if (!isBlob(this)) throw new ERR_INVALID_THIS('Blob'); - - const dec = new TextDecoder(); return dec.decode(await this.arrayBuffer()); }