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/step3_env.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/step3_env.js')
| -rw-r--r-- | js/step3_env.js | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/js/step3_env.js b/js/step3_env.js index b65824f..1f5efb7 100644 --- a/js/step3_env.js +++ b/js/step3_env.js @@ -76,15 +76,7 @@ repl_env.set('*', function(a,b){return a*b;}); repl_env.set('/', function(a,b){return a/b;}); // repl loop -if (typeof require === 'undefined') { - // Asynchronous browser mode - readline.rlwrap(function(line) { return rep(line); }, - function(exc) { - if (exc instanceof reader.BlankException) { return; } - 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> "); @@ -97,6 +89,4 @@ if (typeof require === 'undefined') { else { printer.println(exc); } } } -} else { - exports.rep = rep; } |
