Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

Commit

Permalink
bug for nested variable not usable in 'for' tag
Browse files Browse the repository at this point in the history
There is no need to validate the property "name" of variable 'operand2', because the variable name will be instead as '__loopIter'.

The validation cause syntax like '<% for item in pord.items %>' throw an error, which are availiable in fact.
  • Loading branch information
jinze committed May 27, 2013
1 parent 4ad0b87 commit 7090154
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/tags/for.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ module.exports = function (indent, parser) {
throw new Error('Invalid arguments (' + operand1 + ') passed to "for" tag');
}

if (!helpers.isValidName(operand2.name)) {
throw new Error('Invalid arguments (' + operand2.name + ') passed to "for" tag');
}

operand1 = helpers.escapeVarName(operand1);

loopShared = 'loop.index = __loopIndex + 1;\n' +
Expand Down

0 comments on commit 7090154

Please sign in to comment.