From 50a79584cb12129b3db1ef3e0eb9d0c8b9f20b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 30 May 2019 14:59:30 +0200 Subject: chore: Implement strict mode (denoland/deno_std#453) Original: https://github.com/denoland/deno_std/commit/be24677d15494e83eea2e99bfc5ccfdde31cb892 --- textproto/mod.ts | 5 +++-- textproto/reader_test.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'textproto') diff --git a/textproto/mod.ts b/textproto/mod.ts index 66f303905..6c4e42e51 100644 --- a/textproto/mod.ts +++ b/textproto/mod.ts @@ -82,7 +82,7 @@ export class TextProtoReader { throw new UnexpectedEOFError(); } else if (buf[0] == charCode(" ") || buf[0] == charCode("\t")) { throw new ProtocolError( - `malformed MIME header initial line: ${str(line)}` + `malformed MIME header initial line: ${str(line!)}` ); } @@ -140,7 +140,7 @@ export class TextProtoReader { const { line: l, more } = r; // Avoid the copy if the first call produced a full line. - if (!line && !more) { + if (!line! && !more) { // TODO(ry): // This skipSpace() is definitely misplaced, but I don't know where it // comes from nor how to fix it. @@ -150,6 +150,7 @@ export class TextProtoReader { return l; } + // @ts-ignore line = append(line, l); if (!more) { break; diff --git a/textproto/reader_test.ts b/textproto/reader_test.ts index bd0d39fd3..dfe918282 100644 --- a/textproto/reader_test.ts +++ b/textproto/reader_test.ts @@ -83,7 +83,7 @@ test({ test({ name: "[textproto] Reader : Large MIME Header", async fn(): Promise { - const data = []; + const data: string[] = []; // Go test is 16*1024. But seems it can't handle more for (let i = 0; i < 1024; i++) { data.push("x"); -- cgit v1.2.3