diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-04-29 22:38:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 22:38:10 +0200 |
commit | d308e8d0c0469419517e05a36ba070633168dc67 (patch) | |
tree | 1b9b76c8a443cb781f6c557e964ebae73d64c4bc /cli/js/buffer.ts | |
parent | b51c863550cb377f6e720bccf4f1485ed8d97222 (diff) |
BREAKING: remove custom implementation of Deno.Buffer.toString() (#4992)
Keep in mind Buffer.toString() still exists, but returns [object Object].
Reason for removal of Buffer.toString() was that it implicitly used
TextDecoder with fixed "utf-8" encoding and no way to customize
the encoding.
Diffstat (limited to 'cli/js/buffer.ts')
-rw-r--r-- | cli/js/buffer.ts | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/cli/js/buffer.ts b/cli/js/buffer.ts index fdacf70a9..dbe7606fd 100644 --- a/cli/js/buffer.ts +++ b/cli/js/buffer.ts @@ -6,7 +6,6 @@ import { Reader, Writer, ReaderSync, WriterSync } from "./io.ts"; import { assert } from "./util.ts"; -import { TextDecoder } from "./web/text_encoding.ts"; // MIN_READ is the minimum ArrayBuffer size passed to a read call by // buffer.ReadFrom. As long as the Buffer has at least MIN_READ bytes beyond @@ -44,11 +43,6 @@ export class Buffer implements Reader, ReaderSync, Writer, WriterSync { return this.#buf.subarray(this.#off); } - toString(): string { - const decoder = new TextDecoder(); - return decoder.decode(this.#buf.subarray(this.#off)); - } - empty(): boolean { return this.#buf.byteLength <= this.#off; } |