Fix each_with_index argument handling #807
This fixes #744 and cleans up a couple of related things discovered while down that rabbit hole.
This pull updates the
Also noticed that
The block `RubyEnumerable` creates to handle each_with_index was incorrectly assigned a fixed arity of two. When the `each` we passed this block to is implemented with a `call` rather than a `yield`, this arity was enforced. This resulted in wrapping zero or one arguments in an array or, in the case of more than two arguments, lopping off the extra arguments. Update the each_with_index block to have Arity.OPTIONAL, and fix the EachWithIndex.call logic around packaging up the arguments to handle all arities properly. `RubyEnumerator$EachWithIndex` also needs precisely the same logic around argument packaging, so refactor it to use the fixed `RubyEnumerable$EachWithIndex`