Skip to content

Commit

Permalink
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/org/jruby/RubyYielder.java
Original file line number Diff line number Diff line change
@@ -103,6 +103,10 @@ public IRubyObject yield(ThreadContext context, IRubyObject[]args) {

@JRubyMethod(name = "<<", rest = true)
public IRubyObject op_lshift(ThreadContext context, IRubyObject[]args) {
if (args.length == 1 &&
args[0] instanceof RubyArray &&
((RubyArray) args[0]).getLength() == 1)
args[0] = RubyArray.newArray(context.runtime, args[0]);
yield(context, args);
return this;
}

3 comments on commit cb25efe

@nightscape
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can anyone remember why this change was introduced? It seems to break the expected behavior:
#3814

@headius
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There have been ongoing bugs with Enumerable/Enumerator yielding the proper expanded/unexpanded arrays of args...I don't remember which test/behavior this was supposed to fix.

Sorry, something went wrong.

@nightscape
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Who828 Do you remember by any chance what this change intended to fix? It causes other bugs and I would like to create specs that affirm that all known issues are solved.

Sorry, something went wrong.

Please sign in to comment.