From 678313b17677e012ba9a07aeca58af1aafbf4e8c Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Tue, 28 Apr 2020 17:40:43 +0100 Subject: BREAKING: Remove Deno.EOF, use null instead (#4953) --- cli/js/ops/io.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'cli/js/ops/io.ts') diff --git a/cli/js/ops/io.ts b/cli/js/ops/io.ts index 16b42bfbc..b4ef837e0 100644 --- a/cli/js/ops/io.ts +++ b/cli/js/ops/io.ts @@ -1,7 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { sendAsyncMinimal, sendSyncMinimal } from "./dispatch_minimal.ts"; -import { EOF } from "../io.ts"; // TODO(bartlomieju): remove this import and maybe lazy-initialize // OPS_CACHE that belongs only to this module import { OPS_CACHE } from "../runtime.ts"; @@ -10,7 +9,7 @@ import { OPS_CACHE } from "../runtime.ts"; let OP_READ = -1; let OP_WRITE = -1; -export function readSync(rid: number, buffer: Uint8Array): number | EOF { +export function readSync(rid: number, buffer: Uint8Array): number | null { if (buffer.length == 0) { return 0; } @@ -21,7 +20,7 @@ export function readSync(rid: number, buffer: Uint8Array): number | EOF { if (nread < 0) { throw new Error("read error"); } else if (nread == 0) { - return EOF; + return null; } else { return nread; } @@ -30,7 +29,7 @@ export function readSync(rid: number, buffer: Uint8Array): number | EOF { export async function read( rid: number, buffer: Uint8Array -): Promise { +): Promise { if (buffer.length == 0) { return 0; } @@ -41,7 +40,7 @@ export async function read( if (nread < 0) { throw new Error("read error"); } else if (nread == 0) { - return EOF; + return null; } else { return nread; } -- cgit v1.2.3