diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-09-16 22:22:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-16 22:22:43 +0200 |
commit | 6c4da0e429eb47dae6a220c5576a39f137615bb8 (patch) | |
tree | a8715428caea00105acc9a10fcd0f356085d3fa7 /cli/rt/30_files.js | |
parent | 104aebdfb5d01f7482bacef6d58c2ce16da44334 (diff) |
refactor: remove dispatch_json.js from cli/rt and cli/tsc (#7521)
Instead use Deno.core.jsonOpSync and Deno.core.jsonOpAsync
Diffstat (limited to 'cli/rt/30_files.js')
-rw-r--r-- | cli/rt/30_files.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/rt/30_files.js b/cli/rt/30_files.js index c0a2bbbb6..ff6b85ae5 100644 --- a/cli/rt/30_files.js +++ b/cli/rt/30_files.js @@ -1,9 +1,9 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. ((window) => { + const core = window.Deno.core; const { close } = window.__bootstrap.resources; const { read, readSync, write, writeSync } = window.__bootstrap.io; - const { sendSync, sendAsync } = window.__bootstrap.dispatchJson; const { pathFromURL } = window.__bootstrap.util; function seekSync( @@ -11,7 +11,7 @@ offset, whence, ) { - return sendSync("op_seek_sync", { rid, offset, whence }); + return core.jsonOpSync("op_seek_sync", { rid, offset, whence }); } function seek( @@ -19,7 +19,7 @@ offset, whence, ) { - return sendAsync("op_seek_async", { rid, offset, whence }); + return core.jsonOpAsync("op_seek_async", { rid, offset, whence }); } function openSync( @@ -28,7 +28,7 @@ ) { checkOpenOptions(options); const mode = options?.mode; - const rid = sendSync( + const rid = core.jsonOpSync( "op_open_sync", { path: pathFromURL(path), options, mode }, ); @@ -42,7 +42,7 @@ ) { checkOpenOptions(options); const mode = options?.mode; - const rid = await sendAsync( + const rid = await core.jsonOpAsync( "op_open_async", { path: pathFromURL(path), options, mode }, ); |