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

Commits on Mar 13, 2015

  1. Copy the full SHA
    99e33ff View commit details
  2. Merge pull request #2693 from bjfish/truffle_truffle_concat_to_ary

    [Truffle] Adding #to_ary to Array#concat
    nirvdrum committed Mar 13, 2015
    Copy the full SHA
    613dd63 View commit details
Showing with 10 additions and 2 deletions.
  1. +0 −1 spec/truffle/tags/core/array/concat_tags.txt
  2. +10 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
1 change: 0 additions & 1 deletion spec/truffle/tags/core/array/concat_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
fails:Array#concat tries to convert the passed argument to an Array using #to_ary
fails:Array#concat is not infected by the other
fails:Array#concat is not infected untrustedness by the other
fails:Array#concat returns the array itself
Original file line number Diff line number Diff line change
@@ -597,7 +597,12 @@ public Object compactObjects(RubyArray array) {
}

@CoreMethod(names = "concat", required = 1, raiseIfFrozenSelf = true)
public abstract static class ConcatNode extends ArrayCoreMethodNode {
@NodeChildren({
@NodeChild(value = "array"),
@NodeChild(value = "other")
})
@ImportGuards(ArrayGuards.class)
public abstract static class ConcatNode extends RubyNode {

public ConcatNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
@@ -607,6 +612,10 @@ public ConcatNode(ConcatNode prev) {
super(prev);
}

@CreateCast("other") public RubyNode coerceOtherToAry(RubyNode other) {
return ToAryNodeFactory.create(getContext(), getSourceSection(), other);
}

@Specialization(guards = "areBothNull")
public RubyArray concatNull(RubyArray array, RubyArray other) {
return array;