Skip to content

Commit

Permalink
Not all control exceptions are warnings.
Browse files Browse the repository at this point in the history
This was potentially a problem before, and is certainly one now that
return is done as a control exception too.
  • Loading branch information
jnthn committed Jun 17, 2016
1 parent c0fd19a commit 92ba648
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions lib/Inline/Perl5.pm6
Expand Up @@ -524,15 +524,19 @@ class Perl6Callbacks {
method run($code) {
return EVAL $code;
CONTROL {
note $_.gist;
$_.resume;
when CX::Warn {
note $_.gist;
$_.resume;
}
}
}
method call(Str $name, @args) {
return &::($name)(|@args);
CONTROL {
note $_.gist;
$_.resume;
when CX::Warn {
note $_.gist;
$_.resume;
}
}
}
method invoke(Str $package, Str $name, @args) {
Expand All @@ -541,8 +545,10 @@ class Perl6Callbacks {
%named<True> //= [];
return ::($package)."$name"(|%named<False>, |%(%named<True>));
CONTROL {
note $_.gist;
$_.resume;
when CX::Warn {
note $_.gist;
$_.resume;
}
}
}
method create_pair(Any $key, Mu $value) {
Expand Down Expand Up @@ -919,8 +925,10 @@ method BUILD(*%args) {
my @retvals = $p6obj."$name"(|self.p5_array_to_p6_array($args));
return self.p6_to_p5(@retvals);
CONTROL {
note $_.gist;
$_.resume;
when CX::Warn {
note $_.gist;
$_.resume;
}
}
CATCH {
default {
Expand All @@ -936,8 +944,10 @@ method BUILD(*%args) {
my @retvals = $callable(|self.p5_array_to_p6_array($args));
return self.p6_to_p5(@retvals);
CONTROL {
note $_.gist;
$_.resume;
when CX::Warn {
note $_.gist;
$_.resume;
}
}
CATCH {
default {
Expand Down

0 comments on commit 92ba648

Please sign in to comment.