summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2022-09-28 15:03:56 +0200
committerGitHub <noreply@github.com>2022-09-28 15:03:56 +0200
commit70bc0eb72b01249b4c1ccc92b51bf5c442b3edc9 (patch)
treedbf7839f3db529e7d156426343a8a03963436967 /runtime/js
parentfa9e7aab6d49f241a4eb30cc0e261f8ceb64af2f (diff)
feat(unstable): Deno.setRaw -> Deno.stdin.setRaw (#15797)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/40_files.js5
-rw-r--r--runtime/js/40_tty.js6
-rw-r--r--runtime/js/90_deno_ns.js1
3 files changed, 5 insertions, 7 deletions
diff --git a/runtime/js/40_files.js b/runtime/js/40_files.js
index a2afdb09d..c864d3970 100644
--- a/runtime/js/40_files.js
+++ b/runtime/js/40_files.js
@@ -181,6 +181,11 @@
}
return this.#readable;
}
+
+ setRaw(mode, options = {}) {
+ const cbreak = !!(options.cbreak ?? false);
+ ops.op_stdin_set_raw(mode, cbreak);
+ }
}
class Stdout {
diff --git a/runtime/js/40_tty.js b/runtime/js/40_tty.js
index f43859ed7..be5154fa2 100644
--- a/runtime/js/40_tty.js
+++ b/runtime/js/40_tty.js
@@ -21,14 +21,8 @@
return !!isattyBuffer[0];
}
- const DEFAULT_CBREAK = false;
- function setRaw(rid, mode, options = {}) {
- ops.op_set_raw(rid, mode, options.cbreak || DEFAULT_CBREAK);
- }
-
window.__bootstrap.tty = {
consoleSize,
isatty,
- setRaw,
};
})(this);
diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js
index e7b21640a..33b5d531a 100644
--- a/runtime/js/90_deno_ns.js
+++ b/runtime/js/90_deno_ns.js
@@ -117,7 +117,6 @@
};
__bootstrap.denoNsUnstable = {
- setRaw: __bootstrap.tty.setRaw,
consoleSize: __bootstrap.tty.consoleSize,
DiagnosticCategory: __bootstrap.diagnostics.DiagnosticCategory,
loadavg: __bootstrap.os.loadavg,