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

Commits on Jul 21, 2015

  1. Copy the full SHA
    01b811d View commit details
  2. Kernel#respond_to? and Kernel#respond_to_missing? should only be inst…

    …ance methods.
    
    * And not module functions like many in Kernel.
    eregon committed Jul 21, 2015
    Copy the full SHA
    631e006 View commit details
  3. [Truffle] Fix error message.

    eregon committed Jul 21, 2015
    Copy the full SHA
    693173a View commit details
  4. Copy the full SHA
    0c8c6df View commit details
  5. Copy the full SHA
    da02fc3 View commit details
  6. Copy the full SHA
    2ef04dd View commit details
4 changes: 4 additions & 0 deletions spec/ruby/core/hash/merge_spec.rb
Original file line number Diff line number Diff line change
@@ -7,6 +7,10 @@
it "returns a new hash by combining self with the contents of other" do
h = new_hash(1 => :a, 2 => :b, 3 => :c).merge(:a => 1, :c => 2)
h.should == new_hash(:c => 2, 1 => :a, 2 => :b, :a => 1, 3 => :c)

hash = new_hash(:a => 1, :b => 2)
new_hash().merge(hash).should == hash
hash.merge(new_hash()).should == hash
end

it "sets any duplicate key to the value of block if passed a block" do
4 changes: 4 additions & 0 deletions spec/ruby/core/kernel/respond_to_missing_spec.rb
Original file line number Diff line number Diff line change
@@ -10,6 +10,10 @@
Kernel.should have_private_instance_method(:respond_to_missing?, false)
end

it "is only an instance method" do
Kernel.method(:respond_to_missing?).owner.should == Kernel
end

it "is not called when #respond_to? would return true" do
obj = mock('object')
obj.stub!(:glark)
16 changes: 8 additions & 8 deletions spec/ruby/core/kernel/respond_to_spec.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)

describe "Kernel.respond_to?" do
it "indicates if a singleton object responds to a particular message" do
class KernelSpecs::Foo; def self.bar; 'done'; end; end
KernelSpecs::Foo.respond_to?(:bar).should == true
KernelSpecs::Foo.respond_to?(:baz).should == false
end
end

describe "Kernel#respond_to?" do
before :each do
@a = KernelSpecs::A.new
end

it "is a public method" do
Kernel.should have_public_instance_method(:respond_to?, false)
end

it "is only an instance method" do
Kernel.method(:respond_to?).owner.should == Kernel
end

it "returns false if the given method was undefined" do
@a.respond_to?(:undefed_method).should == false
@a.respond_to?("undefed_method").should == false
2 changes: 2 additions & 0 deletions tool/jruby_eclipse
Original file line number Diff line number Diff line change
@@ -27,6 +27,8 @@ args << "-Djruby.shell=/bin/sh"

java_flags = []
rest = []

ARGV.concat ENV["JRUBY_OPTS"].to_s.split(' ')
ARGV.each { |arg|
if arg.start_with?("-Xmx") or arg == "-ea"
java_flags << arg
1 change: 1 addition & 0 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -423,6 +423,7 @@ def findbugs(report=nil)
end

def check_ambiguous_arguments
ENV.delete "JRUBY_ECLIPSE" # never run from the Eclipse launcher here
pom = "#{JRUBY_DIR}/truffle/pom.rb"
contents = File.read(pom)
contents.gsub!(/^(\s+)'source'\s*=>.+'1.7'.+,\n\s+'target'\s*=>.+\s*'1.7.+,\n/) do
Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@ private void addCoreMethod(MethodDetails methodDetails) {
}
}
if (method.onSingleton() && method.constructor()) {
System.err.println("WARNING: Either onSingleton or isModuleFunction for " + methodDetails.getIndicativeName());
System.err.println("WARNING: Either onSingleton or constructor for " + methodDetails.getIndicativeName());
}

final RubyRootNode rootNode = makeGenericMethod(context, methodDetails);
Original file line number Diff line number Diff line change
@@ -1011,7 +1011,7 @@ public RubyBasicObject mergeEmptyEmpty(RubyBasicObject hash, RubyBasicObject oth
public RubyBasicObject mergeEmptyPacked(RubyBasicObject hash, RubyBasicObject other, NotProvided block) {
final Object[] store = (Object[]) getStore(other);
final Object[] copy = PackedArrayStrategy.copyStore(store);
return createHash(hash.getLogicalClass(), getDefaultBlock(hash), getDefaultValue(hash), copy, getSize(hash), null, null);
return createHash(hash.getLogicalClass(), getDefaultBlock(hash), getDefaultValue(hash), copy, getSize(other), null, null);
}

@Specialization(guards = {