Permalink
Browse files

Merge pull request #110 from apiaryio/fix-for-leak

if tag: avoid leaking __keys variable into global scope
  • Loading branch information...
2 parents 2670e39 + a044f4d commit 05e2d325c4a25bb3b1e180805bb9735d1e74bcd7 @paularmstrong committed Sep 4, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/tags/for.js
View
@@ -38,7 +38,7 @@ module.exports = function (indent, parentBlock, parser) {
parser.compile.apply(this, [indent + ' ', parentBlock]);
out = '(function () {\n' +
- ' var loop = {}, __loopKey, __loopIndex = 0, __loopLength = 0,' +
+ ' var loop = {}, __loopKey, __loopIndex = 0, __loopLength = 0, __keys = [],' +
' __ctx_operand = _context["' + operand1 + '"],\n' +
' loop_cycle = function() {\n' +
' var args = _.toArray(arguments), i = loop.index0 % args.length;\n' +

0 comments on commit 05e2d32

Please sign in to comment.