Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 581ca54775db
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5c6311167b4e
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Nov 26, 2014

  1. Copy the full SHA
    b45f064 View commit details
  2. 9
    Copy the full SHA
    b4113b0 View commit details
  3. Copy the full SHA
    5c63111 View commit details
43 changes: 43 additions & 0 deletions core/src/main/java/org/jruby/truffle/nodes/core/NilClassNodes.java
Original file line number Diff line number Diff line change
@@ -102,4 +102,47 @@ public RubyString toS() {
}
}

@CoreMethod(names = "&", needsSelf = false, required = 1)
public abstract static class AndNode extends CoreMethodNode {

public AndNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public AndNode(AndNode prev) {
super(prev);
}

@Specialization
public boolean and(Object other) {
return false;
}
}

@CoreMethod(names = { "|", "^" }, needsSelf = false, required = 1)
public abstract static class OrXorNode extends CoreMethodNode {

public OrXorNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public OrXorNode(OrXorNode prev) {
super(prev);
}

@Specialization
public boolean or(boolean other) {
return other;
}

@Specialization
public boolean or(RubyNilClass other) {
return false;
}

@Specialization(guards = "!isNil")
public boolean or(RubyObject other) {
return true;
}
}
}
1 change: 0 additions & 1 deletion spec/truffle/tags/core/nil/and_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/nil/or_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/nil/xor_tags.txt

This file was deleted.