Permalink
Browse files

can pass another object to some decode routines

  • Loading branch information...
1 parent c1d4a05 commit ee0a5a5cedc306770ca838de32002b1630b145b9 @makamaka committed Jan 20, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/JSON/PP.pm
View
@@ -889,7 +889,7 @@ BEGIN {
sub array {
- my $a = [];
+ my $a = $_[0] || []; # you can use this code to use another array ref object.
decode_error('json text or perl structure exceeds maximum nesting level (max_depth set too low?)')
if (++$depth > $max_depth);
@@ -939,7 +939,7 @@ BEGIN {
sub object {
- my $o = {};
+ my $o = $_[0] || {}; # you can use this code to use another hash ref object.
my $k;
decode_error('json text or perl structure exceeds maximum nesting level (max_depth set too low?)')

0 comments on commit ee0a5a5

Please sign in to comment.