Skip to content

Commit

Permalink
Fix bad expectation in Module.new that module_exec passes self.
Browse files Browse the repository at this point in the history
Conflicts:

	src/org/jruby/RubyModule.java
  • Loading branch information
headius committed Feb 16, 2012
1 parent 9847379 commit 8d17845
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/org/jruby/RubyModule.java
Expand Up @@ -1877,7 +1877,7 @@ public IRubyObject initialize19(ThreadContext context, Block block) {
if (block.isGiven()) {
// class and module bodies default to public, so make the block's visibility public. JRUBY-1185.
block.getBinding().setVisibility(PUBLIC);
module_exec(context, block);
module_exec(context, new IRubyObject[] {this}, block);
}

return getRuntime().getNil();
Expand Down Expand Up @@ -2301,6 +2301,7 @@ public IRubyObject module_exec(ThreadContext context, Block block) {
throw context.getRuntime().newLocalJumpErrorNoBlock();
}
}

@JRubyMethod(name = {"module_exec", "class_exec"}, rest = true, frame = true)
public IRubyObject module_exec(ThreadContext context, IRubyObject[] args, Block block) {
if (block.isGiven()) {
Expand Down

0 comments on commit 8d17845

Please sign in to comment.