summaryrefslogtreecommitdiff
path: root/io/bufio.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2019-05-30 14:59:30 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-05-30 08:59:30 -0400
commit50a79584cb12129b3db1ef3e0eb9d0c8b9f20b62 (patch)
treeee9a90a8b8018c03b1e1a6ace07abdaa494ea90d /io/bufio.ts
parent80b3c486f6222f65b52eb2eca903b67312e8ce0c (diff)
chore: Implement strict mode (denoland/deno_std#453)
Original: https://github.com/denoland/deno_std/commit/be24677d15494e83eea2e99bfc5ccfdde31cb892
Diffstat (limited to 'io/bufio.ts')
-rw-r--r--io/bufio.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/io/bufio.ts b/io/bufio.ts
index 815c94eed..99b563816 100644
--- a/io/bufio.ts
+++ b/io/bufio.ts
@@ -40,8 +40,8 @@ export interface ReadLineResult {
/** BufReader implements buffering for a Reader object. */
export class BufReader implements Reader {
- private buf: Uint8Array;
- private rd: Reader; // Reader provided by caller.
+ private buf!: Uint8Array;
+ private rd!: Reader; // Reader provided by caller.
private r = 0; // buf read position.
private w = 0; // buf write position.
private eof = false;
@@ -342,7 +342,7 @@ export class BufReader implements Reader {
try {
await this._fill();
} catch (err) {
- err.partial = slice;
+ err.partial = slice!;
throw err;
}
}
@@ -439,7 +439,7 @@ export class BufWriter implements Writer {
if (this.err !== null) throw this.err;
if (this.n === 0) return;
- let n: number;
+ let n = 0;
try {
n = await this.wr.write(this.buf.subarray(0, this.n));
} catch (e) {
@@ -479,7 +479,7 @@ export class BufWriter implements Writer {
if (p.length === 0) return 0;
let nn = 0;
- let n: number;
+ let n = 0;
while (p.byteLength > this.available()) {
if (this.buffered() === 0) {
// Large write, empty buffer.