Setting process.argv[0] to 'coffee' in the REPL (aesthetic)

This commit is contained in:
Trevor Burnham
2011-04-28 18:35:42 -04:00
parent cde7498c8e
commit fe889b8428
2 changed files with 2 additions and 0 deletions

View File

@@ -66,6 +66,7 @@
};
exports.eval = function(code, options) {
var __dirname, __filename;
process.argv[0] = 'coffee';
__filename = module.filename = process.argv[1] = options.filename;
__dirname = path.dirname(__filename);
return eval(compile(code, options));

View File

@@ -82,6 +82,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) ->
process.argv[0] = 'coffee'
__filename = module.filename = process.argv[1] = options.filename
__dirname = path.dirname __filename
eval compile code, options