diff options
Diffstat (limited to 'lib/Text/Handlebars/Compiler.pm')
-rw-r--r-- | lib/Text/Handlebars/Compiler.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Text/Handlebars/Compiler.pm b/lib/Text/Handlebars/Compiler.pm index 2150bba..5f112fc 100644 --- a/lib/Text/Handlebars/Compiler.pm +++ b/lib/Text/Handlebars/Compiler.pm @@ -11,10 +11,12 @@ sub _generate_block { my $self = shift; my ($node) = @_; - return ( - $self->_localize_vars($node->first), - (map { $self->compile_ast($_) } @{ $node->second }), - ); + my @compiled = map { $self->compile_ast($_) } @{ $node->second }; + + unshift @compiled, $self->_localize_vars($node->first) + if $node->first; + + return @compiled; } if (0) { |