summaryrefslogtreecommitdiff
path: root/cli/js/ops
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2020-04-28 17:40:43 +0100
committerGitHub <noreply@github.com>2020-04-28 12:40:43 -0400
commit678313b17677e012ba9a07aeca58af1aafbf4e8c (patch)
treee48e25b165a7d6d566095442448f2e36fa09c561 /cli/js/ops
parent47c2f034e95696a47770d60aec1362501e7f330d (diff)
BREAKING: Remove Deno.EOF, use null instead (#4953)
Diffstat (limited to 'cli/js/ops')
-rw-r--r--cli/js/ops/io.ts9
1 files changed, 4 insertions, 5 deletions
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<number | EOF> {
+): Promise<number | null> {
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;
}