mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
building #2430
This commit is contained in:
parent
1fa3da68ba
commit
a396837fa4
1 changed files with 11 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
// Generated by CoffeeScript 1.3.3
|
||||
(function() {
|
||||
var Lexer, RESERVED, compile, fs, lexer, parser, path, vm, _ref,
|
||||
var Lexer, RESERVED, compile, fs, lexer, parser, path, stripBOM, vm, _ref,
|
||||
__hasProp = {}.hasOwnProperty;
|
||||
|
||||
fs = require('fs');
|
||||
|
@ -13,12 +13,20 @@
|
|||
|
||||
vm = require('vm');
|
||||
|
||||
stripBOM = function(content) {
|
||||
if (content.charCodeAt(0 === 0xFEFF)) {
|
||||
return content.substring(1);
|
||||
} else {
|
||||
return content;
|
||||
}
|
||||
};
|
||||
|
||||
if (require.extensions) {
|
||||
require.extensions['.coffee'] = function(module, filename) {
|
||||
var content;
|
||||
content = compile(fs.readFileSync(filename, 'utf8'), {
|
||||
content = compile(stripBOM(fs.readFileSync(filename, 'utf8'), {
|
||||
filename: filename
|
||||
});
|
||||
}));
|
||||
return module._compile(content, filename);
|
||||
};
|
||||
} else if (require.registerExtension) {
|
||||
|
|
Loading…
Reference in a new issue