diff options
| author | Joel Martin <github@martintribe.org> | 2014-04-26 14:19:49 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-04-26 14:19:49 -0500 |
| commit | e4393504176dc4da117fde95fc10181a2ea6f929 (patch) | |
| tree | 1d33db0f4a66edf23dc8b7149bfd080eb2433268 /js/step0_repl.js | |
| parent | 9b1563a3fb98f04c8280a8840b7dce4f3549234d (diff) | |
| download | mal-e4393504176dc4da117fde95fc10181a2ea6f929.tar.gz mal-e4393504176dc4da117fde95fc10181a2ea6f929.zip | |
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.
Diffstat (limited to 'js/step0_repl.js')
| -rw-r--r-- | js/step0_repl.js | 11 |
1 files changed, 1 insertions, 10 deletions
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; } |
