mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Fixing the REPL.
This commit is contained in:
parent
13f6b037e2
commit
a75368e2e8
4 changed files with 4 additions and 4 deletions
|
@ -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));
|
||||
};
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
fileName: 'repl'
|
||||
});
|
||||
if (val !== undefined) {
|
||||
console.log(inspect(val));
|
||||
console.log(val);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err.stack || err.toString());
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue