Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Do not catch exceptions from eval()
  • Loading branch information
moritz committed Oct 5, 2011
1 parent ff78b5b commit 741a933
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/core/control.pm
Expand Up @@ -147,17 +147,10 @@ sub eval(Str $code, :$lang = 'perl6') {
$P0 = getinterp
%r = $P0['context';1]
};
my $result;
my $success;
try {
my $compiler := pir::compreg__PS($lang);
my $pbc := $compiler.compile($code, :outer_ctx($caller_ctx));
nqp::atpos($pbc, 0).set_outer_ctx($caller_ctx);
$result := $pbc();
$success = 1;
}
pir::find_caller_lex__Ps('$!') = $!;
$success ?? $result !! Any # XXX fail($!)
my $compiler := pir::compreg__PS($lang);
my $pbc := $compiler.compile($code, :outer_ctx($caller_ctx));
nqp::atpos($pbc, 0).set_outer_ctx($caller_ctx);
$pbc();
}


Expand Down

0 comments on commit 741a933

Please sign in to comment.