mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 05:04:48 +00:00
BREAKING: Remove Deno.EOF, use null instead (#4953)
This commit is contained in:
parent
47c2f034e9
commit
678313b176
46 changed files with 329 additions and 325 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue