Skip to content

Commit

Permalink
Enumerable#chunk should behave as a proc or lambda. not normal.
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Mar 4, 2021
1 parent bb5a9ab commit 30d5761
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/RubyEnumerable.java
Original file line number Diff line number Diff line change
Expand Up @@ -1989,7 +1989,8 @@ public static IRubyObject chunk(ThreadContext context, IRubyObject self, final B

IRubyObject enumerator = runtime.getEnumerator().allocate();
enumerator.getInternalVariables().setInternalVariable("chunk_enumerable", self);
enumerator.getInternalVariables().setInternalVariable("chunk_categorize", RubyProc.newProc(runtime, block, block.type));
enumerator.getInternalVariables().setInternalVariable("chunk_categorize",
RubyProc.newProc(runtime, block, block.type == Block.Type.LAMBDA ? block.type : Block.Type.PROC));

Helpers.invoke(context, enumerator, "initialize",
CallBlock.newCallClosure(context, self, Signature.ONE_ARGUMENT,
Expand Down

0 comments on commit 30d5761

Please sign in to comment.