Fixing the REPL.

This commit is contained in:
Jeremy Ashkenas 2010-10-24 21:15:20 -04:00
parent 13f6b037e2
commit a75368e2e8
4 changed files with 4 additions and 4 deletions

View File

@ -48,7 +48,7 @@
};
exports.eval = function(code, options) {
var __dirname, __filename;
__filename = fs.realpathSync(options.fileName);
__filename = options.fileName;
__dirname = path.dirname(__filename);
return eval(exports.compile(code, options));
};

View File

@ -18,7 +18,7 @@
fileName: 'repl'
});
if (val !== undefined) {
console.log(inspect(val));
console.log(val);
}
} catch (err) {
console.error(err.stack || err.toString());

View File

@ -65,7 +65,7 @@ exports.run = (code, options) ->
# Compile and evaluate a string of CoffeeScript (in a Node.js-like environment).
# The CoffeeScript REPL uses this to run the input.
exports.eval = (code, options) ->
__filename = fs.realpathSync options.fileName
__filename = options.fileName
__dirname = path.dirname __filename
eval exports.compile(code, options)

View File

@ -21,7 +21,7 @@ helpers.extend global, quit: -> process.exit(0)
run = (buffer) ->
try
val = CoffeeScript.eval buffer.toString(), bare: on, globals: on, fileName: 'repl'
console.log inspect val if val isnt undefined
console.log val if val isnt undefined
catch err
console.error err.stack or err.toString()
repl.prompt()