From 7090154213f5f701ea1c2efb0c91fe91e1fc5350 Mon Sep 17 00:00:00 2001 From: Ze Jin Date: Mon, 27 May 2013 19:16:36 +0800 Subject: [PATCH] bug for nested variable not usable in 'for' tag 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. --- lib/tags/for.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/tags/for.js b/lib/tags/for.js index f529c012..7f833cef 100644 --- a/lib/tags/for.js +++ b/lib/tags/for.js @@ -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' +