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: 3978423dbc59
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bc6523fdd30d
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Sep 15, 2015

  1. Copy the full SHA
    fec312a View commit details
  2. Copy the full SHA
    bc6523f View commit details
Showing with 15 additions and 1 deletion.
  1. +14 −0 spec/ruby/language/case_spec.rb
  2. +1 −1 truffle/src/main/java/org/jruby/truffle/translator/BodyTranslator.java
14 changes: 14 additions & 0 deletions spec/ruby/language/case_spec.rb
Original file line number Diff line number Diff line change
@@ -365,4 +365,18 @@ def bar; @calls << :bar; end
"bar"
end.should == "bar"
end

it "calls === even when private" do
klass = Class.new do
private
def ===(o)
!!o
end
end

case 1
when klass.new
:called
end.should == :called
end
end
Original file line number Diff line number Diff line change
@@ -766,7 +766,7 @@ public RubyNode visitCaseNode(org.jruby.ast.CaseNode node) {
final ArrayConcatNode arrayConcatNode = (ArrayConcatNode) rubyExpression;
comparisons.add(new WhenSplatNode(context, sourceSection, NodeUtil.cloneNode(readTemp), arrayConcatNode));
} else {
comparisons.add(new RubyCallNode(context, sourceSection, "===", rubyExpression, null, false, NodeUtil.cloneNode(readTemp)));
comparisons.add(new RubyCallNode(context, sourceSection, "===", rubyExpression, null, false, true, NodeUtil.cloneNode(readTemp)));
}
}