aboutsummaryrefslogtreecommitdiff
path: root/js/step2_eval.js
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-04-26 14:19:49 -0500
committerJoel Martin <github@martintribe.org>2014-04-26 14:19:49 -0500
commite4393504176dc4da117fde95fc10181a2ea6f929 (patch)
tree1d33db0f4a66edf23dc8b7149bfd080eb2433268 /js/step2_eval.js
parent9b1563a3fb98f04c8280a8840b7dce4f3549234d (diff)
downloadmal-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/step2_eval.js')
-rw-r--r--js/step2_eval.js12
1 files changed, 1 insertions, 11 deletions
diff --git a/js/step2_eval.js b/js/step2_eval.js
index 72b1f9c..58d561c 100644
--- a/js/step2_eval.js
+++ b/js/step2_eval.js
@@ -62,15 +62,7 @@ repl_env['*'] = function(a,b){return a*b;};
repl_env['/'] = 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> ");
@@ -83,6 +75,4 @@ if (typeof require === 'undefined') {
else { printer.println(exc); }
}
}
-} else {
- exports.rep = rep;
}