summaryrefslogtreecommitdiffstats
path: root/lib/Text/Handlebars.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-08 13:05:02 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-08 13:06:59 -0500
commit7f47485c049416b1c4386d21531f1e50ae3acd79 (patch)
tree80f64ba999b3102ea2dca27c69180b66f851f2fe /lib/Text/Handlebars.pm
parent096cd67f8009aba4ad755aacb9b868a8170c2cce (diff)
downloadtext-handlebars-7f47485c049416b1c4386d21531f1e50ae3acd79.tar.gz
text-handlebars-7f47485c049416b1c4386d21531f1e50ae3acd79.zip
make block helpers recognizable as helpers
Diffstat (limited to 'lib/Text/Handlebars.pm')
-rw-r--r--lib/Text/Handlebars.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Text/Handlebars.pm b/lib/Text/Handlebars.pm
index 328359c..4a66fe6 100644
--- a/lib/Text/Handlebars.pm
+++ b/lib/Text/Handlebars.pm
@@ -121,8 +121,8 @@ sub _register_builtin_methods {
return 1 if try { $weakself->find_file($filename); 1 };
return 0;
};
- $funcs->{'(run_block_helper)'} = sub {
- my ($code, $raw_text, $else_raw_text, $vars, @args) = @_;
+ $funcs->{'(make_block_helper)'} = sub {
+ my ($code, $raw_text, $else_raw_text) = @_;
my $options = {};
$options->{fn} = sub {
@@ -134,7 +134,7 @@ sub _register_builtin_methods {
return $weakself->render_string($else_raw_text, $new_vars);
};
- return $code->($vars, @args, $options);
+ return sub { $code->(@_, $options); };
};
for my $helper (keys %{ $self->{helpers} }) {