Permalink
Browse files

Fix JVM breakage of warnings

Also re-instate private .first to make the most common case of warnings be
as lazy as possible (using the Any.first would vivify all entries still).
  • Loading branch information...
lizmat committed May 18, 2015
1 parent 563abdd commit 00723c69fc49996ea0c08900d43201662354b169
Showing with 10 additions and 3 deletions.
  1. +10 −3 src/core/Backtrace.pm
View
@@ -77,8 +77,8 @@ my class Backtrace {
}
method AT-POS($pos) {
if nqp::atpos($!frames,$pos) -> $frame {
return $frame;
if nqp::existspos($!frames,$pos) {
return nqp::atpos($!frames,$pos);
}
my int $elems = $!bt.elems;
@@ -128,7 +128,7 @@ my class Backtrace {
}
# whatever is there (or not)
nqp::atpos($!frames,$pos);
nqp::existspos($!frames,$pos) ?? nqp::atpos($!frames,$pos) !! Nil;
}
method next-interesting-index(Backtrace:D:
@@ -218,6 +218,13 @@ my class Backtrace {
take $block($cand);
}
}
multi method first(Backtrace:D: Mu $test) {
my $pos = 0;
while self.AT-POS($pos++) -> $cand {
return-rw $cand if $cand ~~ $test;
}
Nil;
}
multi method list(Backtrace:D:) {
self.AT-POS(100); # will stop when done, do we need more than 100???
nqp::p6parcel($!frames,Mu);

0 comments on commit 00723c6

Please sign in to comment.