Skip to content

Commit

Permalink
fix subexpression parsing bug when it in internal helpers. Fix #124
Browse files Browse the repository at this point in the history
  • Loading branch information
Zordius Chen committed Jan 6, 2015
1 parent e3bd98e commit 4bda1c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lightncandy.php
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,7 @@ protected static function compileBlockEnd(&$token, &$context, $vars) {
*/
protected static function compileBlockBegin(&$context, $vars) {
$each = 'false';
$v = isset($vars[1]) ? static::getVariableName($vars[1], $context, true) : array(null, array());
$v = isset($vars[1]) ? static::getVariableNameOrSubExpression($vars[1], $context, true) : array(null, array());
switch ($vars[0][0]) {
case 'if':
$context['stack'][] = 'if';
Expand Down
2 changes: 1 addition & 1 deletion tests/regressionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public function issueProvider()
'flags' => LightnCandy::FLAG_HANDLEBARSJS,
'hbhelpers' => Array(
'equal' => function ($a, $b) {
return a === b;
return $a === $b;
}
),
),
Expand Down

0 comments on commit 4bda1c6

Please sign in to comment.