BREAKING: Remove Deno.EOF, use null instead (#4953)

This commit is contained in:
Nayeem Rahman 2020-04-28 17:40:43 +01:00 committed by GitHub
parent 47c2f034e9
commit 678313b176
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 329 additions and 325 deletions

View file

@ -65,7 +65,7 @@ async function empty(buf: Buffer, s: string, fub: Uint8Array): Promise<void> {
check(buf, s);
while (true) {
const r = await buf.read(fub);
if (r === Deno.EOF) {
if (r === null) {
break;
}
s = s.slice(r);
@ -231,8 +231,7 @@ unitTest(async function bufferTestGrow(): Promise<void> {
for (const growLen of [0, 100, 1000, 10000, 100000]) {
const buf = new Buffer(xBytes.buffer as ArrayBuffer);
// If we read, this affects buf.off, which is good to test.
const result = await buf.read(tmp);
const nread = result === Deno.EOF ? 0 : result;
const nread = (await buf.read(tmp)) ?? 0;
buf.grow(growLen);
const yBytes = repeat("y", growLen);
await buf.write(yBytes);