Skip to content

Commit

Permalink
[truffle] Boolification of scs
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Aug 29, 2018
1 parent 03382b7 commit 190ac50
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -4,6 +4,7 @@
import org.perl6.nqp.truffle.runtime.NQPListIterator;
import org.perl6.nqp.truffle.runtime.NQPList;
import org.perl6.nqp.truffle.runtime.NQPNull;
import org.perl6.nqp.truffle.sixmodel.SerializationContext;

public abstract class NQPToBooleanNode extends NQPBaseNode {
public abstract boolean executeBoolean(Object value);
Expand Down Expand Up @@ -33,6 +34,11 @@ protected boolean doNQPListIterator(NQPListIterator value) {
return ((NQPListIterator) value).boolify();
}

@Specialization
protected boolean doSerializationContext(SerializationContext value) {
return true;
}

@Specialization(guards = "isNull(value)")
protected boolean doNQPNull(Object value) {
return false;
Expand Down

0 comments on commit 190ac50

Please sign in to comment.