From e4393504176dc4da117fde95fc10181a2ea6f929 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Sat, 26 Apr 2014 14:19:49 -0500 Subject: JS: switch from josh.js console to jqconsole. js/web/jqconsole.min.js and web/ansi.css are from https://github.com/replit/jq-console and licensed MIT. --- js/step0_repl.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'js/step0_repl.js') diff --git a/js/step0_repl.js b/js/step0_repl.js index c13be2d..f9fa60e 100644 --- a/js/step0_repl.js +++ b/js/step0_repl.js @@ -21,14 +21,7 @@ function PRINT(exp) { var rep = function(str) { return PRINT(EVAL(READ(str), {})); }; // repl loop -if (typeof require === 'undefined') { - // Asynchronous browser mode - readline.rlwrap(function(line) { return rep(line); }, - function(exc) { - if (exc.stack) { printer.println(exc.stack); } - else { printer.println(exc); } - }); -} else if (require.main === module) { +if (typeof require !== 'undefined' && require.main === module) { // Synchronous node.js commandline mode while (true) { var line = readline.readline("user> "); @@ -41,6 +34,4 @@ if (typeof require === 'undefined') { else { printer.println(exc); } } } -} else { - exports.rep = rep; } -- cgit v1.2.3