Skip to content

Commit

Permalink
Fix container handling in sub DUMP(), which also fixes uninitialized …
Browse files Browse the repository at this point in the history
…value warnings caused by %ctx{$where} being set for the container instead of the contents
  • Loading branch information
japhb committed Apr 4, 2013
1 parent 09a04e3 commit 92f888a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/Mu.pm
Expand Up @@ -528,6 +528,9 @@ multi sub infix:<eqv>(@a, @b) {

sub DUMP(|args (*@args, :$indent-step = 4, :%ctx?)) {
my Mu $topic := nqp::captureposarg(nqp::usecapture(), 0);
return "\x25b6" ~ DUMP(nqp::decont($topic), :$indent-step, :%ctx)
if nqp::iscont($topic);

my str $type = pir::typeof__SP($topic);
my str $where = nqp::base_I(nqp::where($topic), 16);

Expand Down Expand Up @@ -555,8 +558,7 @@ sub DUMP(|args (*@args, :$indent-step = 4, :%ctx?)) {
@pieces.DUMP-PIECES($before, :$indent-step);
}
elsif nqp::can($topic, 'DUMP') {
my $dump := $topic.DUMP(:$indent-step, :%ctx);
nqp::iscont($topic) ?? "\x25b6" ~ $dump !! $dump;
$topic.DUMP(:$indent-step, :%ctx);
}
else {
$type ~ '<' ~ $obj_num ~ '>(...)';
Expand Down

0 comments on commit 92f888a

Please sign in to comment.