Skip to content

Commit e6b9101

Browse files
committed
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.
1 parent d8ff663 commit e6b9101

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/QRegex/Cursor.nqp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ role NQPCursorRole is export {
2727
my $submatch;
2828
my $name;
2929

30-
if !nqp::isnull($!regexsub) && $!regexsub {
30+
if !nqp::isnull($!regexsub) && nqp::defined($!regexsub) {
3131
%caplist := nqp::can($!regexsub, 'CAPS') ?? $!regexsub.CAPS() !! nqp::null();
3232
if !nqp::isnull(%caplist) && %caplist {
3333
$iter := nqp::iterator(%caplist);
@@ -88,7 +88,7 @@ role NQPCursorRole is export {
8888
};
8989
nqp::bindattr($new, $?CLASS, '$!orig', $!orig);
9090
nqp::bindattr($new, $?CLASS, '$!regexsub', nqp::ifnull(nqp::getcodeobj($sub), $sub));
91-
if $!restart {
91+
if nqp::defined($!restart) {
9292
nqp::bindattr_i($new, $?CLASS, '$!pos', $!pos);
9393
nqp::bindattr($new, $?CLASS, '$!cstack', nqp::clone($!cstack)) if $!cstack;
9494
pir::return__0PsiPPi(
@@ -155,7 +155,7 @@ role NQPCursorRole is export {
155155
}
156156

157157
method !cursor_next() {
158-
if $!restart {
158+
if nqp::defined($!restart) {
159159
$!restart(self);
160160
}
161161
else {

0 commit comments

Comments
 (0)