mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
x = {} if x -> x and= {}, per Michael's suggestion
https://github.com/jashkenas/coffee-script/pull/1324/files#r25463
This commit is contained in:
@@ -48,9 +48,7 @@
|
||||
var Module, mainModule;
|
||||
mainModule = require.main;
|
||||
mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.';
|
||||
if (mainModule.moduleCache) {
|
||||
mainModule.moduleCache = {};
|
||||
}
|
||||
mainModule.moduleCache && (mainModule.moduleCache = {});
|
||||
if (process.binding('natives').module) {
|
||||
Module = require('module').Module;
|
||||
mainModule.paths = Module._nodeModulePaths(path.dirname(options.filename));
|
||||
|
||||
@@ -61,7 +61,7 @@ exports.run = (code, options) ->
|
||||
if options.filename then fs.realpathSync(options.filename) else '.'
|
||||
|
||||
# Clear the module cache.
|
||||
mainModule.moduleCache = {} if mainModule.moduleCache
|
||||
mainModule.moduleCache and= {}
|
||||
|
||||
# Assign paths for node_modules loading
|
||||
if process.binding('natives').module
|
||||
|
||||
Reference in New Issue
Block a user