Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't booleanize code objects in Cursor.
Now that $!regexsub is the actual code object, boolifying it doesn't
play well with Perl 6 code objects.
  • Loading branch information
jnthn committed Oct 21, 2012
1 parent d8ff663 commit e6b9101
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/QRegex/Cursor.nqp
Expand Up @@ -27,7 +27,7 @@ role NQPCursorRole is export {
my $submatch;
my $name;

if !nqp::isnull($!regexsub) && $!regexsub {
if !nqp::isnull($!regexsub) && nqp::defined($!regexsub) {
%caplist := nqp::can($!regexsub, 'CAPS') ?? $!regexsub.CAPS() !! nqp::null();
if !nqp::isnull(%caplist) && %caplist {
$iter := nqp::iterator(%caplist);
Expand Down Expand Up @@ -88,7 +88,7 @@ role NQPCursorRole is export {
};
nqp::bindattr($new, $?CLASS, '$!orig', $!orig);
nqp::bindattr($new, $?CLASS, '$!regexsub', nqp::ifnull(nqp::getcodeobj($sub), $sub));
if $!restart {
if nqp::defined($!restart) {
nqp::bindattr_i($new, $?CLASS, '$!pos', $!pos);
nqp::bindattr($new, $?CLASS, '$!cstack', nqp::clone($!cstack)) if $!cstack;
pir::return__0PsiPPi(
Expand Down Expand Up @@ -155,7 +155,7 @@ role NQPCursorRole is export {
}

method !cursor_next() {
if $!restart {
if nqp::defined($!restart) {
$!restart(self);
}
else {
Expand Down

0 comments on commit e6b9101

Please sign in to comment.