Skip to content

Commit

Permalink
store JSON::Any object that holds the reference to the current encode…
Browse files Browse the repository at this point in the history
…r object. This prevents JSON::Any to change the backend later, by modules like WWW::Facebook::API.
  • Loading branch information
miyagawa committed Aug 3, 2007
1 parent 53aa595 commit f35892f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Catalyst/View/JSON.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ sub new {

eval {
JSON::Any->import($driver);
$self->json_dumper(sub { JSON::Any->objToJson($_[0]) });
my $json = JSON::Any->new; # create the copy of JSON handler
$self->json_dumper(sub { $json->objToJson($_[0]) });
};

if (my $error = $@) {
Expand Down

0 comments on commit f35892f

Please sign in to comment.