Skip to content

Commit

Permalink
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions core/src/main/java/org/jruby/runtime/IRBlockBody.java
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ public IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg

@Override
public IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Binding binding, Type type) {
return call(context, new IRubyObject[] {arg0, arg1, arg2}, binding, type, Block.NULL_BLOCK);
return call(context, new IRubyObject[]{arg0, arg1, arg2}, binding, type, Block.NULL_BLOCK);
}

@Override
@@ -97,17 +97,19 @@ IRubyObject yieldSpecificMultiArgsCommon(ThreadContext context, IRubyObject[] ar

@Override
public IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Binding binding, Type type) {
return yieldSpecificMultiArgsCommon(context, new IRubyObject[] { arg0, arg1 }, binding, type);
return yieldSpecificMultiArgsCommon(context, new IRubyObject[]{arg0, arg1}, binding, type);
}

@Override
public IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Binding binding, Type type) {
return yieldSpecificMultiArgsCommon(context, new IRubyObject[] { arg0, arg1, arg2 }, binding, type);
return yieldSpecificMultiArgsCommon(context, new IRubyObject[]{arg0, arg1, arg2}, binding, type);
}

private IRubyObject[] toAry(ThreadContext context, IRubyObject value) {
IRubyObject val0 = Helpers.aryToAry(value);

if (val0.isNil()) return new IRubyObject[] { value };

if (!(val0 instanceof RubyArray)) {
throw context.runtime.newTypeError(value.getType().getName() + "#to_ary should return Array");
}
1 change: 0 additions & 1 deletion spec/tags/ruby/language/block_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
fails:A block yielded a single Array assigns elements to optional arguments
fails:A block yielded a single Array assigns the last element to a non-keyword argument if #to_hash returns nil
fails:A block yielded a single Array raises a TypeError if #to_hash does not return a Hash
fails:A block yielded a single Object receives the object if #to_ary returns nil
fails:A block yielded a single Array does not treat hashes with string keys as keyword arguments
fails:A block yielded a single Array calls #to_hash on the last element when there are more arguments than parameters
fails:A block yielded a single Array assigns symbol keys from a Hash to keyword arguments

0 comments on commit 25aa878

Please sign in to comment.