summaryrefslogtreecommitdiff
path: root/modules/esm/console.js
diff options
context:
space:
mode:
authorEvan Welsh <contact@evanwelsh.com>2022-01-29 19:05:36 -0800
committerEvan Welsh <contact@evanwelsh.com>2023-03-12 11:20:22 -0700
commit064894bf82755f51aaa1f762c06cacc8bf55720f (patch)
tree98269f755c62a3fbaad7f50a1634c915dfaa9452 /modules/esm/console.js
parent8ad123caf2cc794c88914ea70f5c8527555883c1 (diff)
downloadgjs-064894bf82755f51aaa1f762c06cacc8bf55720f.tar.gz
Refactor console utilities
Diffstat (limited to 'modules/esm/console.js')
-rw-r--r--modules/esm/console.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/esm/console.js b/modules/esm/console.js
index 1532624d..9b57f97b 100644
--- a/modules/esm/console.js
+++ b/modules/esm/console.js
@@ -1,6 +1,10 @@
// SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
// SPDX-FileCopyrightText: 2021 Evan Welsh <contact@evanwelsh.com>
+import GLib from 'gi://GLib';
+
+const NativeConsole = import.meta.importSync('_consoleNative');
+
const DEFAULT_LOG_DOMAIN = 'Gjs-Console';
// A line-by-line implementation of https://console.spec.whatwg.org/.
@@ -109,7 +113,7 @@ class Console {
*/
clear() {
this.#groupIndentation = '';
- imports.gi.GjsPrivate.clear_terminal();
+ NativeConsole.clearTerminal();
}
/**