aboutsummaryrefslogtreecommitdiff
path: root/js/step0_repl.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/step0_repl.js')
-rw-r--r--js/step0_repl.js11
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;
}