Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix nested each statements. #2

Merged
merged 1 commit into from Mar 21, 2012
Jump to file or symbol
Failed to load files and symbols.
+3 −2
Split
View
@@ -45,7 +45,8 @@ var parse = {
each: function(_, iter, value, array){
if (!value) iter = (value = iter, 'iterator' + iterator++);
- return 'for (var ' + iter + ' = 0, l = ' + array + '.length; ' + iter + ' < l; ' + iter + '++) {' + 'var ' + value + ' = ' + array + '[' + (iter) + '];';
+ var length = 'length' + iterator++;
+ return 'for (var ' + iter + ' = 0, ' + length + ' = ' + array + '.length; ' + iter + ' < ' + length + '; ' + iter + '++) {' + 'var ' + value + ' = ' + array + '[' + (iter) + '];';
},
end: function(){
@@ -95,4 +96,4 @@ Beard = {
}
-module.exports = Beard;
+module.exports = Beard;