diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-02-15 13:59:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-15 13:59:04 +0100 |
commit | 9b5e336c3d9b9c9d3b520ddb2ff80502b155ed3f (patch) | |
tree | a07abb2c69bcb0b2fd941a446675b82818725340 /runtime/js | |
parent | bdc8006a362b4f95107a25ca816dcdedb7f44e4a (diff) |
feat: Add Deno.FsFile, deprecate Deno.File (#13660)
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/40_files.js | 9 | ||||
-rw-r--r-- | runtime/js/40_process.js | 8 | ||||
-rw-r--r-- | runtime/js/90_deno_ns.js | 1 |
3 files changed, 10 insertions, 8 deletions
diff --git a/runtime/js/40_files.js b/runtime/js/40_files.js index b0d651d5c..8aa0a4972 100644 --- a/runtime/js/40_files.js +++ b/runtime/js/40_files.js @@ -41,7 +41,7 @@ { path: pathFromURL(path), options, mode }, ); - return new File(rid); + return new FsFile(rid); } async function open( @@ -55,7 +55,7 @@ { path: pathFromURL(path), options, mode }, ); - return new File(rid); + return new FsFile(rid); } function createSync(path) { @@ -76,7 +76,7 @@ }); } - class File { + class FsFile { #rid = 0; #readable; @@ -272,7 +272,8 @@ stdin, stdout, stderr, - File, + File: FsFile, + FsFile, create, createSync, open, diff --git a/runtime/js/40_process.js b/runtime/js/40_process.js index 8d9f402ff..14c31fa8d 100644 --- a/runtime/js/40_process.js +++ b/runtime/js/40_process.js @@ -3,7 +3,7 @@ ((window) => { const core = window.Deno.core; - const { File } = window.__bootstrap.files; + const { FsFile } = window.__bootstrap.files; const { readAll } = window.__bootstrap.io; const { assert, pathFromURL } = window.__bootstrap.util; const { @@ -46,15 +46,15 @@ this.pid = res.pid; if (res.stdinRid && res.stdinRid > 0) { - this.stdin = new File(res.stdinRid); + this.stdin = new FsFile(res.stdinRid); } if (res.stdoutRid && res.stdoutRid > 0) { - this.stdout = new File(res.stdoutRid); + this.stdout = new FsFile(res.stdoutRid); } if (res.stderrRid && res.stderrRid > 0) { - this.stderr = new File(res.stderrRid); + this.stderr = new FsFile(res.stderrRid); } } diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index 871062394..d52f267c0 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -76,6 +76,7 @@ write: __bootstrap.io.write, writeSync: __bootstrap.io.writeSync, File: __bootstrap.files.File, + FsFile: __bootstrap.files.FsFile, open: __bootstrap.files.open, openSync: __bootstrap.files.openSync, create: __bootstrap.files.create, |