mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
accept override
This commit is contained in:
parent
b7f0653a0e
commit
9b6772a390
2 changed files with 5 additions and 3 deletions
|
@ -100,12 +100,14 @@
|
|||
};
|
||||
|
||||
exports.run = function(code, options) {
|
||||
var answer, mainModule;
|
||||
var answer, mainModule, _ref1;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
mainModule = require.main;
|
||||
options.sourceMap = true;
|
||||
if ((_ref1 = options.sourceMap) == null) {
|
||||
options.sourceMap = true;
|
||||
}
|
||||
mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.';
|
||||
mainModule.moduleCache && (mainModule.moduleCache = {});
|
||||
mainModule.paths = require('module')._nodeModulePaths(path.dirname(fs.realpathSync(options.filename)));
|
||||
|
|
|
@ -96,7 +96,7 @@ exports.nodes = (source, options) ->
|
|||
# setting `__filename`, `__dirname`, and relative `require()`.
|
||||
exports.run = (code, options = {}) ->
|
||||
mainModule = require.main
|
||||
options.sourceMap = true
|
||||
options.sourceMap ?= true
|
||||
# Set the filename.
|
||||
mainModule.filename = process.argv[1] =
|
||||
if options.filename then fs.realpathSync(options.filename) else '.'
|
||||
|
|
Loading…
Reference in a new issue