summaryrefslogtreecommitdiff
path: root/cli/tools
diff options
context:
space:
mode:
authorColin Ihrig <cjihrig@gmail.com>2022-04-20 15:48:15 -0400
committerGitHub <noreply@github.com>2022-04-20 15:48:15 -0400
commit2a93c134dc93d70b5f6ea9d417c88207661884d5 (patch)
tree09fecb2f1c44da117309e2ad436ffa56860c9b6e /cli/tools
parentf785ecee1a68faac517a6d35763dd26ef033d722 (diff)
feat(repl): add global clear() function (#14332)
This commit adds a clear() function in the REPL which works similar to console.clear().
Diffstat (limited to 'cli/tools')
-rw-r--r--cli/tools/repl/session.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/tools/repl/session.rs b/cli/tools/repl/session.rs
index 57109eb1d..d72fc9499 100644
--- a/cli/tools/repl/session.rs
+++ b/cli/tools/repl/session.rs
@@ -41,6 +41,8 @@ Object.defineProperty(globalThis, "_error", {
console.log("Last thrown error is no longer saved to _error.");
},
});
+
+globalThis.clear = console.clear.bind(console);
"#;
pub enum EvaluationOutput {