Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make try do "use fatal", as per spec.
This makes various things fail more violently than they used to, so
we get a bunch of spectest failures as a result. We use a dynvar for
conveying if "use fatal" is in effect, which is consistent with S04's
requirement that "The fail function responds to the caller's use fatal
state. It either returns an unthrown exception, or throws..." Clearly
this has to be caller in the transitive to be of any use. Placing this
in a branch so we don't lose it.
  • Loading branch information
jnthn committed Apr 8, 2015
1 parent 3b45f6a commit 722f81a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Perl6/Actions.nqp
Expand Up @@ -1415,9 +1415,14 @@ class Perl6::Actions is HLL::Actions does STDActions {
}

method statement_prefix:sym<try>($/) {
my $block := $<blorst>.ast;
# Ensure "use fatal" is in force.
my $block := $<blorst>.ast;
my $past_block := $block.ann('past_block');
$*W.install_lexical_symbol($past_block, '$*FATAL', $*W.find_symbol(['True']));

# Add catch handler.
my $past;
if $block.ann('past_block').ann('handlers') && $block.ann('past_block').ann('handlers')<CATCH> {
if $past_block.ann('handlers') && $past_block.ann('handlers')<CATCH> {
# we already have a CATCH block, nothing to do here
$past := QAST::Op.new( :op('call'), $block );
} else {
Expand Down

0 comments on commit 722f81a

Please sign in to comment.