-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
Milestone
Description
Enumerable#each_entry is supposed to convert multiple arguments to an array, but the behaviour is different from MRI and jruby 1.7 when multiple arguments are yielded.
jruby -v:
jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 24.76-b04 on 1.7.0_76-b13 +jit [linux-amd64]
jruby 9.1.5.0 (2.3.1) 2016-09-07 036ce39 Java HotSpot(TM) 64-Bit Server VM 24.76-b04 on 1.7.0_76-b13 +jit [linux-x86_64]
test file:
class Foo
include Enumerable
def each
yield 1
yield 1, 2
yield
end
end
out = []
Foo.new.each_entry{ |*args| out << args }
puts "each_entry: #{out.inspect}"Expected output:
==[1.9.3-p551]==
each_entry: [[1], [[1, 2]], [nil]]
==[2.0.0-p648]==
each_entry: [[1], [[1, 2]], [nil]]
==[2.1.10]==
each_entry: [[1], [[1, 2]], [nil]]
==[2.2.6]==
each_entry: [[1], [[1, 2]], [nil]]
==[2.3.3]==
each_entry: [[1], [[1, 2]], [nil]]
==[2.4.0]==
each_entry: [[1], [[1, 2]], [nil]]
==[jruby-1.7.26]==
each_entry: [[1], [[1, 2]], [nil]]
jruby 9.x output:
==[jruby-9.0.5.0]==
each_entry: [[1], [1, 2], [nil]]
==[jruby-9.1.7.0]==
each_entry: [[1], [1, 2], [nil]]
Reactions are currently unavailable