Skip to content

Commit

Permalink
Make Regex.gist|raku handle absence of $!source properly
Browse files Browse the repository at this point in the history
Since the $!source attribute is a native string, one should use
nqp::isnull_s() for checks, which precludes from using nqp::ifnull.
  • Loading branch information
lizmat committed Jul 28, 2023
1 parent eb60db5 commit 924d534
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core.c/Regex.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ my class Regex { # declared in BOOTSTRAP
}

multi method gist(Regex:D:) {
nqp::ifnull($!source,'')
nqp::isnull_s($!source) ?? '' !! $!source
}

multi method raku(Regex:D:) {
nqp::ifnull($!source,'')
nqp::isnull_s($!source) ?? '' !! $!source
}

method clone(Mu :$topic is raw, Mu :$slash is raw --> Regex) {
Expand Down

0 comments on commit 924d534

Please sign in to comment.