Skip to content

Commit

Permalink
Cheat less with failures. They actually throw now.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Feb 10, 2010
1 parent 3a94b96 commit 446afaf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/cheats/fail.pir
Expand Up @@ -7,6 +7,13 @@ Return a Failure object using C<args> as the failure message.
.namespace []
.sub '!FAIL'
.param pmc args :slurpy
$P0 = new ['Undef']
.return ($P0)
$P0 = new ['Exception']
$S0 = join '', args
$P1 = box $S0
setattribute $P0, 'message', $P1
$P1 = get_hll_global 'Exception'
$P0 = $P1.'new'($P0)
$P1 = get_hll_global 'Failure'
$P1 = $P1.'new'($P0)
.return ($P1)
.end

0 comments on commit 446afaf

Please sign in to comment.