summaryrefslogtreecommitdiff
path: root/runtime/js/90_deno_ns.js
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-01-25 03:26:49 +1100
committerGitHub <noreply@github.com>2024-01-24 17:26:49 +0100
commitf5097d9d3b62f7dc8e29e85e12f6a6f2858addbf (patch)
tree63a828e08571bf8bbde3e341e48392c91bf645fe /runtime/js/90_deno_ns.js
parent6b5c9764ac8087d035ef6a3f2542bd089957035e (diff)
feat: `Deno.FsFile.{utime,utimeSync}()` and deprecate `Deno.{futime,futimeSync}` (#22070)
For removal in Deno v2. --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com> Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'runtime/js/90_deno_ns.js')
-rw-r--r--runtime/js/90_deno_ns.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js
index 72ba0c8d1..638e7afe7 100644
--- a/runtime/js/90_deno_ns.js
+++ b/runtime/js/90_deno_ns.js
@@ -108,8 +108,22 @@ const denoNs = {
);
return fs.ftruncate(rid, len);
},
- futime: fs.futime,
- futimeSync: fs.futimeSync,
+ async futime(rid, atime, mtime) {
+ internals.warnOnDeprecatedApi(
+ "Deno.futime()",
+ new Error().stack,
+ "Use `Deno.FsFile.utime()` instead.",
+ );
+ await fs.futime(rid, atime, mtime);
+ },
+ futimeSync(rid, atime, mtime) {
+ internals.warnOnDeprecatedApi(
+ "Deno.futimeSync()",
+ new Error().stack,
+ "Use `Deno.FsFile.utimeSync()` instead.",
+ );
+ fs.futimeSync(rid, atime, mtime);
+ },
errors: errors.errors,
inspect: console.inspect,
env: os.env,