mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
CoffeeScript.run should be able to safely omit options
This commit is contained in:
@@ -64,6 +64,7 @@
|
||||
|
||||
exports.run = function(code, options) {
|
||||
var mainModule;
|
||||
if (options == null) options = {};
|
||||
mainModule = require.main;
|
||||
mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.';
|
||||
mainModule.moduleCache && (mainModule.moduleCache = {});
|
||||
|
||||
@@ -57,7 +57,7 @@ exports.nodes = (source, options) ->
|
||||
|
||||
# Compile and execute a string of CoffeeScript (on the server), correctly
|
||||
# setting `__filename`, `__dirname`, and relative `require()`.
|
||||
exports.run = (code, options) ->
|
||||
exports.run = (code, options = {}) ->
|
||||
mainModule = require.main
|
||||
|
||||
# Set the filename.
|
||||
|
||||
Reference in New Issue
Block a user