Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix try to put error in $!, not inline
  • Loading branch information
sorear committed Oct 21, 2010
1 parent 876edf3 commit 94651cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Kernel.cs
Expand Up @@ -1283,6 +1283,11 @@ class ExitRunloopException : Exception { }
tf.caller.resultSlot = Kernel.NewROScalar(Kernel.AnyP);
return tf.caller;
}
} else if (type == SubInfo.ON_DIE) {
if (tf.lex == null)
tf.lex = new Dictionary<string,object>();
tf.lex["$*!"] = td;
td = Kernel.NewROScalar(Kernel.AnyP);
}
tf.ip = tip;
tf.resultSlot = td;
Expand Down
3 changes: 3 additions & 0 deletions test2.pl
Expand Up @@ -64,6 +64,9 @@
token TOP:foo { <sym> }
}).parse("foo");
is $m<sym>, "foo", '$<sym> is functional';

ok !(try die "foo").defined, "try of an error is undef";
is $!, "foo", 'the error goes into $!';
}

# {
Expand Down

0 comments on commit 94651cd

Please sign in to comment.