Skip to content

Commit

Permalink
succeed in creating error message much more often
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Apr 21, 2012
1 parent 7c97944 commit 754e4a0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/Backtrace.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ my class Backtrace is List {
}

multi method Str(Backtrace::Frame:D:) {
my $s = $.subtype;
my $s = self.subtype;
$s ~= ' ' if $s.chars;
" in {$s}$.subname at {$.file}:$.line\n"
}
Expand Down Expand Up @@ -67,16 +67,16 @@ my class Backtrace is List {
# but it turns out that a simple perl6 -e 'die "foo"'
# has two bt frames from the mainline; so it's OK to never
# consider the last one
loop (; $idx < $.end; ++$idx) {
my $cand = $.at_pos($idx);
loop (; $idx < self.end; ++$idx) {
my $cand = self.at_pos($idx);
return $idx unless $cand.is-hidden;
}
Int;
}

method outer-caller-idx(Int $startidx is copy) {
my %print;
my $start = $.at_pos($startidx).code;
my $start = self.at_pos($startidx).code;
return $startidx.list unless $start;
my $current = $start.outer;
my %outers;
Expand All @@ -86,9 +86,9 @@ my class Backtrace is List {
}
my @outers;
loop (my Int $i = $startidx; $i < $.end; ++$i) {
if $.at_pos($i).code && %outers{%.at_pos($i).code.static_id} {
if self.at_pos($i).code && %outers{self.at_pos($i).code.static_id} {
@outers.push: $i;
return @outers if $.at_pos($i).is-routine;
return @outers if self.at_pos($i).is-routine;
}
}

Expand Down

0 comments on commit 754e4a0

Please sign in to comment.