summaryrefslogtreecommitdiff
path: root/std/io/bufio.ts
diff options
context:
space:
mode:
authorMarcos Casagrande <marcoscvp90@gmail.com>2020-06-12 21:15:29 +0200
committerGitHub <noreply@github.com>2020-06-12 15:15:29 -0400
commit26bf56afdaf16634ffbaa23684faf3a44cc10f62 (patch)
tree25265007d7b09bd4580659ae34d833759df745d2 /std/io/bufio.ts
parent7d41bacfba6a3557066345ecd282f0d83e4a4381 (diff)
fix(std/io): BufWriter/StringWriter bug (#6247)
Diffstat (limited to 'std/io/bufio.ts')
-rw-r--r--std/io/bufio.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/std/io/bufio.ts b/std/io/bufio.ts
index 4ebec13e1..e4759dcb7 100644
--- a/std/io/bufio.ts
+++ b/std/io/bufio.ts
@@ -486,6 +486,7 @@ export class BufWriter extends AbstractBufBase implements Writer {
this.checkBytesWritten(numBytesWritten);
+ this.buf = new Uint8Array(this.buf.length);
this.usedBufferBytes = 0;
}
@@ -580,6 +581,7 @@ export class BufWriterSync extends AbstractBufBase implements WriterSync {
this.checkBytesWritten(numBytesWritten);
+ this.buf = new Uint8Array(this.buf.length);
this.usedBufferBytes = 0;
}