mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Remove (compiled) from filenames, to keep __filename accurate
This commit is contained in:
@@ -10,8 +10,7 @@
|
||||
require.extensions['.coffee'] = function(module, filename) {
|
||||
var content;
|
||||
content = compile(fs.readFileSync(filename, 'utf8'));
|
||||
module.filename = ("" + (filename) + " (compiled)");
|
||||
return module._compile(content, module.filename);
|
||||
return module._compile(content, filename);
|
||||
};
|
||||
} else if (require.registerExtension) {
|
||||
require.registerExtension('.coffee', function(content) {
|
||||
@@ -37,12 +36,12 @@
|
||||
return parser.parse(lexer.tokenize(code));
|
||||
};
|
||||
exports.run = function(code, options) {
|
||||
var __filename, root;
|
||||
var root;
|
||||
root = module;
|
||||
while (root.parent) {
|
||||
root = root.parent;
|
||||
}
|
||||
root.filename = (__filename = ("" + (options.fileName) + " (compiled)"));
|
||||
root.filename = options.fileName;
|
||||
if (root.moduleCache) {
|
||||
root.moduleCache = {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user