normalizing loop declarations towards common JS practice.

This commit is contained in:
Jeremy Ashkenas
2010-10-21 21:51:06 -04:00
parent 0342b0a89f
commit c92fd79f35
11 changed files with 126 additions and 89 deletions

View File

@@ -49,8 +49,9 @@
};
compileScripts = function() {
var _i, _len, _ref2, _result, base, compile, source;
_ref2 = sources;
_result = [];
for (_i = 0, _len = (_ref2 = sources).length; _i < _len; ++_i) {
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
source = _ref2[_i];
_result.push((function() {
base = path.join(source);
@@ -64,7 +65,7 @@
return fs.readdir(source, function(err, files) {
var _j, _len2, _result2, file;
_result2 = [];
for (_j = 0, _len2 = files.length; _j < _len2; ++_j) {
for (_j = 0, _len2 = files.length; _j < _len2; _j++) {
file = files[_j];
_result2.push(compile(path.join(source, file)));
}
@@ -89,7 +90,8 @@
o = opts;
options = compileOptions(file);
if (o.require) {
for (_i = 0, _len = (_ref2 = o.require).length; _i < _len; ++_i) {
_ref2 = o.require;
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
req = _ref2[_i];
require(helpers.starts(req, '.') ? fs.realpathSync(req) : req);
}
@@ -186,7 +188,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];