Skip to content

Commit

Permalink
stash key shortcuts do not need to return the invocant
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 12, 2014
1 parent b480d06 commit 3d50d55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/Mojolicious/Plugin/DefaultHelpers.pm
Expand Up @@ -20,9 +20,8 @@ sub register {
$app->helper(
$name => sub {
my $c = shift;
return return $c->stash->{$name} unless @_;
$c->stash($name => shift, @_);
return $c;
$c->stash($name => shift, @_) if @_;
return $c->stash->{$name};
}
);
}
Expand Down
3 changes: 2 additions & 1 deletion t/mojolicious/layouted_lite_app.t
Expand Up @@ -28,7 +28,7 @@ hook after_render => sub {
# Default layout for whole application
app->defaults(layout => 'default');

get '/works' => sub { shift->title('Just works')->render };
get '/works';

get '/mixed';

Expand Down Expand Up @@ -287,6 +287,7 @@ Mixed <%= content %>
Blue<%= title %><%= content %>
@@ works.html.ep
% title 'Just works';
% layout 'green' if param 'green';
% extends 'blue' if param 'blue';
This <template> just works!
Expand Down

0 comments on commit 3d50d55

Please sign in to comment.