Skip to content

Commit

Permalink
in EXCEPTION, check for the payload rather than the excpetion type, w…
Browse files Browse the repository at this point in the history
…hich varies more than I thought it does
  • Loading branch information
moritz committed Sep 27, 2011
1 parent 4659b25 commit b1481ba
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/core/Exception.pm
Expand Up @@ -18,14 +18,11 @@ my class Exception {

sub EXCEPTION(|$) {
my Mu $parrot_ex := nqp::shift(pir::perl6_current_args_rpa__P());
if nqp::p6bool(nqp::iseq_i(nqp::atkey($parrot_ex, 'type'), pir::const::CONTROL_ERROR)) {

my Mu $payload := nqp::atkey($parrot_ex, 'payload');
my $ex := pir::defined($payload) ?? $payload !! nqp::create(Exception);
nqp::bindattr($ex, Exception, '$!ex', $parrot_ex);
$ex;
my Mu $payload := nqp::atkey($parrot_ex, 'payload');
if nqp::p6bool(pir::type_check__IPP($payload, Exception)) {
nqp::bindattr($payload, Exception, '$!ex', $parrot_ex);
$payload;
} else {
nqp::say("Caught exception of unknown type -- this probably should not happen");
my $ex := nqp::create(Exception);
nqp::bindattr($ex, Exception, '$!ex', $parrot_ex);
$ex;
Expand Down

0 comments on commit b1481ba

Please sign in to comment.