New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
convert 'new Failure' to '!FAIL' #301
Comments
From @pmichaudFor rakudo builtin functions that are written in PIR, use .return '!FAIL'('...message...') instead of the old-style $P0 = new 'Failure' Functions that have return exception handlers in place fail '...'; Pm |
From @ronaldxsOn Sun Sep 07 10:29:52 2008, pmichaud wrote:
The attached patches address part of the stated problem. I will try to In languages/perl6/src/classes/List.pir: In languages/perl6/src/classes/Object.pir: In languages/perl6/src/classes/Code.pir: I may have missed a pir 'Failure' object creation or so somewhere but |
From @ronaldxsfailure_mod.patchIndex: src/classes/Array.pir
===================================================================
--- src/classes/Array.pir (revision 30888)
+++ src/classes/Array.pir (working copy)
@@ -132,7 +132,7 @@
x = pop self
goto done
empty:
- x = new 'Failure'
+ x = '!FAIL'('Undefined value popped from empty array')
done:
.return (x)
.end
@@ -165,7 +165,7 @@
x = shift self
goto done
empty:
- x = new 'Failure'
+ x = '!FAIL'('Undefined value shifted from empty array')
done:
.return (x)
.end
Index: src/classes/List.pir
===================================================================
--- src/classes/List.pir (revision 30888)
+++ src/classes/List.pir (working copy)
@@ -256,8 +256,7 @@
goto done
nomatch:
- retv = new 'Failure'
- goto done
+ retv = '!FAIL'('Undefined value - first list match of no matches')
done:
.return(retv)
Index: src/classes/Object.pir
===================================================================
--- src/classes/Object.pir (revision 30888)
+++ src/classes/Object.pir (working copy)
@@ -428,8 +428,7 @@
# For now we won't worry about signature, just if a method exists.
$I0 = can self, method_name
if $I0 goto invoke
- $P0 = get_hll_global 'Failure'
- .return ($P0)
+ .return '!FAIL'('Undefined value returned by invocation of undefined method')
# If we do have a method, call it.
invoke:
|
The RT System itself - Status changed from 'new' to 'open' |
From @moritzOn Mon Sep 08 13:49:44 2008, ronaldxs wrote:
Thanks, applied as r31544. Moritz |
From @ronaldxsUsing find/grep to find calls to "new 'Failure'" in the current (non- Suggesting the possible closing of this ticket. src/builtins/any-str.pir:184: $P0 = new 'Failure' |
From @jnthnOn Sun Sep 07 10:29:52 2008, pmichaud wrote:
Thanks to those who contributed patches towards this effort. I've just Jonathan |
@jnthn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#58646 (status was 'resolved')
Searchable as RT58646$
The text was updated successfully, but these errors were encountered: