Skip to content

Commit

Permalink
Fix specs where proc passed to lambda stays a proc?
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed May 12, 2015
1 parent 7c78686 commit 7e94aec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion core/src/main/java/org/jruby/RubyKernel.java
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,10 @@ public static RubyProc proc(ThreadContext context, IRubyObject recv, Block block

@JRubyMethod(module = true, visibility = PRIVATE)
public static RubyProc lambda(ThreadContext context, IRubyObject recv, Block block) {
return context.runtime.newProc(Block.Type.LAMBDA, block);
// If we encounter a amp'd proc we leave it a proc for some reason.
Block.Type type = block.type == Block.Type.PROC ? block.type : Block.Type.LAMBDA;

return context.runtime.newProc(type, block);
}

@JRubyMethod(name = "proc", module = true, visibility = PRIVATE)
Expand Down
1 change: 0 additions & 1 deletion spec/tags/ruby/core/proc/hash_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/ruby/core/proc/lambda_tags.txt

This file was deleted.

0 comments on commit 7e94aec

Please sign in to comment.