From 8e08d111da1b92dd0dcd1d64e55cb463865e1137 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 13 Apr 2020 21:08:54 +0100 Subject: [PATCH] js: Output text using printf() and return undefined in help() --- Userland/js.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Userland/js.cpp b/Userland/js.cpp index 9e6f64b556..a31b932792 100644 --- a/Userland/js.cpp +++ b/Userland/js.cpp @@ -301,15 +301,13 @@ JS::Value ReplObject::exit_interpreter(JS::Interpreter& interpreter) return JS::js_undefined(); } -JS::Value ReplObject::repl_help(JS::Interpreter& interpreter) +JS::Value ReplObject::repl_help(JS::Interpreter&) { - StringBuilder help_text; - help_text.append("REPL commands:\n"); - help_text.append(" exit(code): exit the REPL with specified code. Defaults to 0.\n"); - help_text.append(" help(): display this menu\n"); - help_text.append(" load(files): Accepts file names as params to load into running session. For example repl.load(\"js/1.js\", \"js/2.js\", \"js/3.js\")\n"); - String result = help_text.to_string(); - return js_string(interpreter, result); + printf("REPL commands:\n"); + printf(" exit(code): exit the REPL with specified code. Defaults to 0.\n"); + printf(" help(): display this menu\n"); + printf(" load(files): Accepts file names as params to load into running session. For example load(\"js/1.js\", \"js/2.js\", \"js/3.js\")\n"); + return JS::js_undefined(); } JS::Value ReplObject::load_file(JS::Interpreter& interpreter)