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

Commits on Apr 20, 2016

  1. Copy the full SHA
    2fa2830 View commit details
  2. Copy the full SHA
    246f505 View commit details
Showing with 7 additions and 1 deletion.
  1. +4 −0 spec/ruby/core/array/initialize_spec.rb
  2. +2 −0 spec/ruby/core/array/new_spec.rb
  3. +1 −1 truffle/src/main/java/org/jruby/truffle/core/array/ArrayNodes.java
4 changes: 4 additions & 0 deletions spec/ruby/core/array/initialize_spec.rb
Original file line number Diff line number Diff line change
@@ -92,6 +92,10 @@
a.send(:initialize, 2, obj).should == [obj, obj]
a[0].should equal(obj)
a[1].should equal(obj)

b = []
b.send(:initialize, 3, 14).should == [14, 14, 14]
b.should == [14, 14, 14]
end

it "sets the array to size and fills with nil when object is omitted" do
2 changes: 2 additions & 0 deletions spec/ruby/core/array/new_spec.rb
Original file line number Diff line number Diff line change
@@ -65,6 +65,8 @@
a.should == [obj, obj]
a[0].should equal(obj)
a[1].should equal(obj)

Array.new(3, 14).should == [14, 14, 14]
end

it "returns an array of size filled with nil when object is omitted" do
Original file line number Diff line number Diff line change
@@ -956,7 +956,7 @@ public DynamicObject initializeWithSizeNoDefault(DynamicObject array, int size,
return array;
}

@Specialization(guards = { "size >= 0", "wasProvided(defaultValue)", "strategy.specializesFor(array)" }, limit = "ARRAY_STRATEGIES")
@Specialization(guards = { "size >= 0", "wasProvided(defaultValue)", "strategy.specializesFor(defaultValue)" }, limit = "ARRAY_STRATEGIES")
public DynamicObject initializeWithSizeAndDefault(DynamicObject array, int size, Object defaultValue, NotProvided block,
@Cached("forValue(defaultValue)") ArrayStrategy strategy,
@Cached("createBinaryProfile()") ConditionProfile needsFill) {