diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-10-18 20:13:38 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-01-02 13:56:20 -0600 |
commit | adb96fb612699aacd3519fd3b5e0ec778922ca92 (patch) | |
tree | 7709ed667da534866abe9faba2af099b39738b1e /lib/Text | |
parent | 458ba9a07adb5634dd17a936411e738e13a74826 (diff) | |
download | text-handlebars-adb96fb612699aacd3519fd3b5e0ec778922ca92.tar.gz text-handlebars-adb96fb612699aacd3519fd3b5e0ec778922ca92.zip |
don't constant-fold render_string
Diffstat (limited to 'lib/Text')
-rw-r--r-- | lib/Text/Handlebars/Compiler.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Text/Handlebars/Compiler.pm b/lib/Text/Handlebars/Compiler.pm index ebcce23..40314b2 100644 --- a/lib/Text/Handlebars/Compiler.pm +++ b/lib/Text/Handlebars/Compiler.pm @@ -186,7 +186,9 @@ sub _generate_unary { $self->compile_ast($node->first), $self->opcode($node->id) ); - if( $Text::Xslate::Compiler::OPTIMIZE and $self->_code_is_literal($code[0]) ) { + # render_string can't be constant folded, because it depends on the + # current vars + if ($Text::Xslate::Compiler::OPTIMIZE and $self->_code_is_literal(@code) && $node->id ne 'render_string') { $self->_fold_constants(\@code); } return @code; |