Skip to content

Commit 3b52341

Browse files
committed
Fix subclass impl of pre.
1 parent 716a16c commit 3b52341

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/src/main/java/org/jruby/internal/runtime/methods/CompiledIRMetaClassBody.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.jruby.ir.IRFlags;
55
import org.jruby.ir.IRMetaClassBody;
66
import org.jruby.ir.IRScope;
7+
import org.jruby.parser.StaticScope;
78
import org.jruby.runtime.Block;
89
import org.jruby.runtime.DynamicScope;
910
import org.jruby.runtime.ThreadContext;
@@ -41,14 +42,14 @@ protected void post(ThreadContext context) {
4142
}
4243

4344
@Override
44-
protected void pre(ThreadContext context, IRubyObject self, String name, Block block) {
45+
protected void pre(ThreadContext context, StaticScope staticScope, RubyModule implementationClass, IRubyObject self, String name, Block block) {
4546
// update call stacks (push: frame, class, scope, etc.)
46-
context.preMethodFrameOnly(getImplementationClass(), name, self, block);
47+
context.preMethodFrameOnly(implementationClass, name, self, block);
4748
if (pushNewDynScope) {
4849
// Add a parent-link to current dynscope to support non-local returns cheaply
4950
// This doesn't affect variable scoping since local variables will all have
5051
// the right scope depth.
51-
context.pushScope(DynamicScope.newDynamicScope(method.getStaticScope(), context.getCurrentScope()));
52+
context.pushScope(DynamicScope.newDynamicScope(staticScope, context.getCurrentScope()));
5253
}
5354
context.setCurrentVisibility(getVisibility());
5455
}

0 commit comments

Comments
 (0)