From bced52505f32d6cca4f944bb610a8a26767908a8 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Sun, 29 Mar 2020 04:03:49 +1100 Subject: Update to Prettier 2 and use ES Private Fields (#4498) --- cli/js/web/blob.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'cli/js/web/blob.ts') diff --git a/cli/js/web/blob.ts b/cli/js/web/blob.ts index 31674a62d..5309ddaf4 100644 --- a/cli/js/web/blob.ts +++ b/cli/js/web/blob.ts @@ -124,12 +124,8 @@ function processBlobParts( return bytes; } -// A WeakMap holding blob to byte array mapping. -// Ensures it does not impact garbage collection. -export const blobBytesWeakMap = new WeakMap(); - export class DenoBlob implements domTypes.Blob { - private readonly [bytesSymbol]: Uint8Array; + [bytesSymbol]: Uint8Array; readonly size: number = 0; readonly type: string = ""; @@ -165,14 +161,11 @@ export class DenoBlob implements domTypes.Blob { this[bytesSymbol] = bytes; this.size = bytes.byteLength; this.type = normalizedType; - - // Register bytes for internal private use. - blobBytesWeakMap.set(this, bytes); } slice(start?: number, end?: number, contentType?: string): DenoBlob { return new DenoBlob([this[bytesSymbol].slice(start, end)], { - type: contentType || this.type + type: contentType || this.type, }); } } -- cgit v1.2.3