mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Merge pull request #2819 from hden/fix-path
Quick fix for node v0.10 path
This commit is contained in:
@@ -110,7 +110,7 @@
|
||||
}
|
||||
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)));
|
||||
mainModule.paths = require('module')._nodeModulePaths(path.dirname(fs.realpathSync(options.filename || '.')));
|
||||
if (!helpers.isCoffee(mainModule.filename) || require.extensions) {
|
||||
answer = compile(code, options);
|
||||
patchStackTrace();
|
||||
|
||||
@@ -105,7 +105,7 @@ exports.run = (code, options = {}) ->
|
||||
mainModule.moduleCache and= {}
|
||||
|
||||
# Assign paths for node_modules loading
|
||||
mainModule.paths = require('module')._nodeModulePaths path.dirname fs.realpathSync options.filename
|
||||
mainModule.paths = require('module')._nodeModulePaths path.dirname fs.realpathSync options.filename or '.'
|
||||
|
||||
# Compile.
|
||||
if not helpers.isCoffee(mainModule.filename) or require.extensions
|
||||
@@ -277,4 +277,5 @@ formatSourcePosition = (frame, getSourceMapping) ->
|
||||
else if functionName
|
||||
"#{functionName} (#{fileLocation})"
|
||||
else
|
||||
fileLocation
|
||||
fileLocation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user