mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
merging the range-killer to master
This commit is contained in:
@@ -48,43 +48,39 @@
|
||||
return compileScripts();
|
||||
};
|
||||
compileScripts = function() {
|
||||
var _i, _j, _len, _ref2, _result, base, compile, source;
|
||||
var _i, _len, _ref2, _result, base, compile, source;
|
||||
_result = [];
|
||||
for (_i = 0, _len = (_ref2 = sources).length; _i < _len; _i++) {
|
||||
(function() {
|
||||
var source = _ref2[_i];
|
||||
_j = source;
|
||||
return _result.push((function() {
|
||||
base = path.join(source);
|
||||
compile = function(source, topLevel) {
|
||||
return path.exists(source, function(exists) {
|
||||
if (!exists) {
|
||||
throw new Error("File not found: " + source);
|
||||
for (_i = 0, _len = (_ref2 = sources).length; _i < _len; ++_i) {
|
||||
source = _ref2[_i];
|
||||
_result.push((function() {
|
||||
base = path.join(source);
|
||||
compile = function(source, topLevel) {
|
||||
return path.exists(source, function(exists) {
|
||||
if (!exists) {
|
||||
throw new Error("File not found: " + source);
|
||||
}
|
||||
return fs.stat(source, function(err, stats) {
|
||||
if (stats.isDirectory()) {
|
||||
return fs.readdir(source, function(err, files) {
|
||||
var _j, _len2, _result2, file;
|
||||
_result2 = [];
|
||||
for (_j = 0, _len2 = files.length; _j < _len2; ++_j) {
|
||||
file = files[_j];
|
||||
_result2.push(compile(path.join(source, file)));
|
||||
}
|
||||
return _result2;
|
||||
});
|
||||
} else if (topLevel || path.extname(source) === '.coffee') {
|
||||
fs.readFile(source, function(err, code) {
|
||||
return compileScript(source, code.toString(), base);
|
||||
});
|
||||
return opts.watch ? watch(source, base) : undefined;
|
||||
}
|
||||
return fs.stat(source, function(err, stats) {
|
||||
if (stats.isDirectory()) {
|
||||
return fs.readdir(source, function(err, files) {
|
||||
var _k, _len2, _result2, file;
|
||||
_result2 = [];
|
||||
for (_k = 0, _len2 = files.length; _k < _len2; _k++) {
|
||||
file = files[_k];
|
||||
_result2.push(compile(path.join(source, file)));
|
||||
}
|
||||
return _result2;
|
||||
});
|
||||
} else if (topLevel || path.extname(source) === '.coffee') {
|
||||
fs.readFile(source, function(err, code) {
|
||||
return compileScript(source, code.toString(), base);
|
||||
});
|
||||
return opts.watch ? watch(source, base) : undefined;
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
return compile(source, true);
|
||||
})());
|
||||
})();
|
||||
source = _j;
|
||||
});
|
||||
};
|
||||
return compile(source, true);
|
||||
})());
|
||||
}
|
||||
return _result;
|
||||
};
|
||||
@@ -93,7 +89,7 @@
|
||||
o = opts;
|
||||
options = compileOptions(file);
|
||||
if (o.require) {
|
||||
for (_i = 0, _len = (_ref2 = o.require).length; _i < _len; _i++) {
|
||||
for (_i = 0, _len = (_ref2 = o.require).length; _i < _len; ++_i) {
|
||||
req = _ref2[_i];
|
||||
require(helpers.starts(req, '.') ? fs.realpathSync(req) : req);
|
||||
}
|
||||
@@ -190,7 +186,7 @@
|
||||
var _i, _len, _ref2, _result, strings, tag, token, value;
|
||||
strings = (function() {
|
||||
_result = [];
|
||||
for (_i = 0, _len = tokens.length; _i < _len; _i++) {
|
||||
for (_i = 0, _len = tokens.length; _i < _len; ++_i) {
|
||||
token = tokens[_i];
|
||||
_result.push((function() {
|
||||
_ref2 = [token[0], token[1].toString().replace(/\n/, '\\n')], tag = _ref2[0], value = _ref2[1];
|
||||
|
||||
Reference in New Issue
Block a user