summaryrefslogtreecommitdiff
path: root/cli/js/ops
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/ops')
-rw-r--r--cli/js/ops/fetch.ts2
-rw-r--r--cli/js/ops/fs/make_temp.ts8
-rw-r--r--cli/js/ops/fs/open.ts2
-rw-r--r--cli/js/ops/fs/read_link.ts2
-rw-r--r--cli/js/ops/fs/realpath.ts2
-rw-r--r--cli/js/ops/fs/seek.ts2
-rw-r--r--cli/js/ops/fs_events.ts6
-rw-r--r--cli/js/ops/net.ts6
-rw-r--r--cli/js/ops/process.ts2
-rw-r--r--cli/js/ops/repl.ts2
-rw-r--r--cli/js/ops/runtime_compiler.ts4
-rw-r--r--cli/js/ops/signal.ts2
-rw-r--r--cli/js/ops/tls.ts4
-rw-r--r--cli/js/ops/worker_host.ts2
14 files changed, 21 insertions, 25 deletions
diff --git a/cli/js/ops/fetch.ts b/cli/js/ops/fetch.ts
index 8d6a461ab..09b9ac1ec 100644
--- a/cli/js/ops/fetch.ts
+++ b/cli/js/ops/fetch.ts
@@ -15,7 +15,7 @@ export interface FetchResponse {
headers: Array<[string, string]>;
}
-export async function fetch(
+export function fetch(
args: FetchRequest,
body: ArrayBufferView | undefined
): Promise<FetchResponse> {
diff --git a/cli/js/ops/fs/make_temp.ts b/cli/js/ops/fs/make_temp.ts
index aeab9afc7..85dea5f20 100644
--- a/cli/js/ops/fs/make_temp.ts
+++ b/cli/js/ops/fs/make_temp.ts
@@ -11,9 +11,7 @@ export function makeTempDirSync(options: MakeTempOptions = {}): string {
return sendSync("op_make_temp_dir", options);
}
-export async function makeTempDir(
- options: MakeTempOptions = {}
-): Promise<string> {
+export function makeTempDir(options: MakeTempOptions = {}): Promise<string> {
return sendAsync("op_make_temp_dir", options);
}
@@ -21,8 +19,6 @@ export function makeTempFileSync(options: MakeTempOptions = {}): string {
return sendSync("op_make_temp_file", options);
}
-export async function makeTempFile(
- options: MakeTempOptions = {}
-): Promise<string> {
+export function makeTempFile(options: MakeTempOptions = {}): Promise<string> {
return sendAsync("op_make_temp_file", options);
}
diff --git a/cli/js/ops/fs/open.ts b/cli/js/ops/fs/open.ts
index 2ac5c715c..87696935f 100644
--- a/cli/js/ops/fs/open.ts
+++ b/cli/js/ops/fs/open.ts
@@ -26,7 +26,7 @@ export function openSync(
return sendSync("op_open", { path, options, openMode, mode });
}
-export async function open(
+export function open(
path: string,
openMode: OpenMode | undefined,
options: OpenOptions | undefined
diff --git a/cli/js/ops/fs/read_link.ts b/cli/js/ops/fs/read_link.ts
index 403cd6def..4ac8db3db 100644
--- a/cli/js/ops/fs/read_link.ts
+++ b/cli/js/ops/fs/read_link.ts
@@ -5,6 +5,6 @@ export function readlinkSync(path: string): string {
return sendSync("op_read_link", { path });
}
-export async function readlink(path: string): Promise<string> {
+export function readlink(path: string): Promise<string> {
return sendAsync("op_read_link", { path });
}
diff --git a/cli/js/ops/fs/realpath.ts b/cli/js/ops/fs/realpath.ts
index e68e32bf0..e8a904079 100644
--- a/cli/js/ops/fs/realpath.ts
+++ b/cli/js/ops/fs/realpath.ts
@@ -5,6 +5,6 @@ export function realpathSync(path: string): string {
return sendSync("op_realpath", { path });
}
-export async function realpath(path: string): Promise<string> {
+export function realpath(path: string): Promise<string> {
return sendAsync("op_realpath", { path });
}
diff --git a/cli/js/ops/fs/seek.ts b/cli/js/ops/fs/seek.ts
index dfac9bf63..c7e4c9172 100644
--- a/cli/js/ops/fs/seek.ts
+++ b/cli/js/ops/fs/seek.ts
@@ -10,7 +10,7 @@ export function seekSync(
return sendSync("op_seek", { rid, offset, whence });
}
-export async function seek(
+export function seek(
rid: number,
offset: number,
whence: SeekMode
diff --git a/cli/js/ops/fs_events.ts b/cli/js/ops/fs_events.ts
index 706efc1b0..4c08995b8 100644
--- a/cli/js/ops/fs_events.ts
+++ b/cli/js/ops/fs_events.ts
@@ -15,15 +15,15 @@ class FsEvents implements AsyncIterableIterator<FsEvent> {
this.rid = sendSync("op_fs_events_open", { recursive, paths });
}
- async next(): Promise<IteratorResult<FsEvent>> {
+ next(): Promise<IteratorResult<FsEvent>> {
return sendAsync("op_fs_events_poll", {
rid: this.rid
});
}
- async return(value?: FsEvent): Promise<IteratorResult<FsEvent>> {
+ return(value?: FsEvent): Promise<IteratorResult<FsEvent>> {
close(this.rid);
- return { value, done: true };
+ return Promise.resolve({ value, done: true });
}
[Symbol.asyncIterator](): AsyncIterableIterator<FsEvent> {
diff --git a/cli/js/ops/net.ts b/cli/js/ops/net.ts
index 5a72be8c6..25f3a8322 100644
--- a/cli/js/ops/net.ts
+++ b/cli/js/ops/net.ts
@@ -31,7 +31,7 @@ interface AcceptResponse {
};
}
-export async function accept(rid: number): Promise<AcceptResponse> {
+export function accept(rid: number): Promise<AcceptResponse> {
return sendAsync("op_accept", { rid });
}
@@ -74,7 +74,7 @@ export interface ConnectRequest {
port: number;
}
-export async function connect(args: ConnectRequest): Promise<ConnectResponse> {
+export function connect(args: ConnectRequest): Promise<ConnectResponse> {
return sendAsync("op_connect", args);
}
@@ -87,7 +87,7 @@ interface ReceiveResponse {
};
}
-export async function receive(
+export function receive(
rid: number,
zeroCopy: Uint8Array
): Promise<ReceiveResponse> {
diff --git a/cli/js/ops/process.ts b/cli/js/ops/process.ts
index 845909d5d..384718cef 100644
--- a/cli/js/ops/process.ts
+++ b/cli/js/ops/process.ts
@@ -12,7 +12,7 @@ interface RunStatusResponse {
exitSignal: number;
}
-export async function runStatus(rid: number): Promise<RunStatusResponse> {
+export function runStatus(rid: number): Promise<RunStatusResponse> {
return sendAsync("op_run_status", { rid });
}
diff --git a/cli/js/ops/repl.ts b/cli/js/ops/repl.ts
index 3f40f4456..1781aa089 100644
--- a/cli/js/ops/repl.ts
+++ b/cli/js/ops/repl.ts
@@ -6,6 +6,6 @@ export function startRepl(historyFile: string): number {
return sendSync("op_repl_start", { historyFile });
}
-export async function readline(rid: number, prompt: string): Promise<string> {
+export function readline(rid: number, prompt: string): Promise<string> {
return sendAsync("op_repl_readline", { rid, prompt });
}
diff --git a/cli/js/ops/runtime_compiler.ts b/cli/js/ops/runtime_compiler.ts
index 035a4ef59..b46670ace 100644
--- a/cli/js/ops/runtime_compiler.ts
+++ b/cli/js/ops/runtime_compiler.ts
@@ -9,7 +9,7 @@ interface CompileRequest {
bundle: boolean;
}
-export async function compile(request: CompileRequest): Promise<string> {
+export function compile(request: CompileRequest): Promise<string> {
return sendAsync("op_compile", request);
}
@@ -18,6 +18,6 @@ interface TranspileRequest {
options?: string;
}
-export async function transpile(request: TranspileRequest): Promise<string> {
+export function transpile(request: TranspileRequest): Promise<string> {
return sendAsync("op_transpile", request);
}
diff --git a/cli/js/ops/signal.ts b/cli/js/ops/signal.ts
index 3c8d021a0..09c178105 100644
--- a/cli/js/ops/signal.ts
+++ b/cli/js/ops/signal.ts
@@ -5,7 +5,7 @@ export function bindSignal(signo: number): { rid: number } {
return sendSync("op_signal_bind", { signo });
}
-export async function pollSignal(rid: number): Promise<{ done: boolean }> {
+export function pollSignal(rid: number): Promise<{ done: boolean }> {
return sendAsync("op_signal_poll", { rid });
}
diff --git a/cli/js/ops/tls.ts b/cli/js/ops/tls.ts
index b52ad65bb..e52143cb0 100644
--- a/cli/js/ops/tls.ts
+++ b/cli/js/ops/tls.ts
@@ -23,7 +23,7 @@ interface ConnectTLSResponse {
};
}
-export async function connectTLS(
+export function connectTLS(
args: ConnectTLSRequest
): Promise<ConnectTLSResponse> {
return sendAsync("op_connect_tls", args);
@@ -43,7 +43,7 @@ interface AcceptTLSResponse {
};
}
-export async function acceptTLS(rid: number): Promise<AcceptTLSResponse> {
+export function acceptTLS(rid: number): Promise<AcceptTLSResponse> {
return sendAsync("op_accept_tls", { rid });
}
diff --git a/cli/js/ops/worker_host.ts b/cli/js/ops/worker_host.ts
index 1a7e671f4..0b9f81795 100644
--- a/cli/js/ops/worker_host.ts
+++ b/cli/js/ops/worker_host.ts
@@ -24,6 +24,6 @@ export function hostPostMessage(id: number, data: Uint8Array): void {
sendSync("op_host_post_message", { id }, data);
}
-export async function hostGetMessage(id: number): Promise<any> {
+export function hostGetMessage(id: number): Promise<any> {
return sendAsync("op_host_get_message", { id });
}