From 2a93c134dc93d70b5f6ea9d417c88207661884d5 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Wed, 20 Apr 2022 15:48:15 -0400 Subject: feat(repl): add global clear() function (#14332) This commit adds a clear() function in the REPL which works similar to console.clear(). --- cli/tools/repl/session.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cli/tools') 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 { -- cgit v1.2.3