ref: 76e400fb67a966ecebd172f6e14a348ce21bea1f
parent: 434ae67268c108d372392c0c45dd7b50ea33ba4d
author: Tor Andersson <[email protected]>
date: Thu Mar 10 12:42:25 EST 2022
Add "console" object to mujs shell.
--- a/main.c
+++ b/main.c
@@ -230,6 +230,10 @@
"};\n"
;
+static const char *console_js =
+ "var console = { log: print, debug: print, warn: print, error: print };"
+;
+
static int eval_print(js_State *J, const char *source)
{
if (js_ploadstring(J, "[stdin]", source)) {
@@ -337,6 +341,7 @@
js_dostring(J, require_js);
js_dostring(J, stacktrace_js);
+ js_dostring(J, console_js);
if (xoptind == argc) {
interactive = 1;