feat(unstable): Deno.setRaw -> Deno.stdin.setRaw (#15797)

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Luca Casonato 2022-09-28 15:03:56 +02:00 committed by GitHub
parent fa9e7aab6d
commit 70bc0eb72b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 43 additions and 50 deletions

View file

@ -181,6 +181,11 @@
}
return this.#readable;
}
setRaw(mode, options = {}) {
const cbreak = !!(options.cbreak ?? false);
ops.op_stdin_set_raw(mode, cbreak);
}
}
class Stdout {

View file

@ -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);

View file

@ -117,7 +117,6 @@
};
__bootstrap.denoNsUnstable = {
setRaw: __bootstrap.tty.setRaw,
consoleSize: __bootstrap.tty.consoleSize,
DiagnosticCategory: __bootstrap.diagnostics.DiagnosticCategory,
loadavg: __bootstrap.os.loadavg,