Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't hand null strings back from QAST::Op.
  • Loading branch information
jnthn committed Feb 28, 2013
1 parent 60f479a commit 431f8fb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions nqp-src/QASTNodes.nqp
Expand Up @@ -342,9 +342,18 @@ class QAST::Op is QAST::Node {
has str $!op;
has str $!childorder;

method name(*@value) { $!name := @value[0] if @value; $!name || "" }
method op(*@value) { $!op := @value[0] if @value; $!op }
method childorder(*@value) { $!childorder := @value[0] if @value; $!childorder || "" }
method name(*@value) {
$!name := @value[0] if @value;
nqp::isnull_s($!name) ?? "" !! $!name
}
method op(*@value) {
$!op := @value[0] if @value;
nqp::isnull_s($!op) ?? "" !! $!op
}
method childorder(*@value) {
$!childorder := @value[0] if @value;
nqp::isnull_s($!childorder) ?? "" !! $!childorder
}

method substitute_inline_placeholders(@fillers) {
my $result := self.shallow_clone();
Expand Down

0 comments on commit 431f8fb

Please sign in to comment.