Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
replace a wad of PIR code with Perl 6; also preserves the argument ty…
…pe of &fail
  • Loading branch information
moritz committed Mar 25, 2012
1 parent 008dd40 commit 34c3e35
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/core/Failure.pm
Expand Up @@ -41,18 +41,8 @@ my class Failure {
my &fail := -> *@msg {
my $value = @msg == 1 ?? @msg[0] !! @msg.join('');
die $value if $*FATAL;
my Mu $ex := Q:PIR {
# throw and immediately catch an exception, to capture
# the location at the point of the fail()
push_eh catch
$P0 = find_lex '$value'
$S0 = $P0
die $S0
catch:
.get_results (%r)
pop_eh
};
my $fail := Failure.new(EXCEPTION($ex));
try die $value;
my $fail := Failure.new($!);
my Mu $return := pir::find_caller_lex__Ps('RETURN');
$return($fail) unless nqp::isnull($return);
$fail
Expand Down

0 comments on commit 34c3e35

Please sign in to comment.