Skip to content

Commit

Permalink
Do not provide a frame name for toplevel.
Browse files Browse the repository at this point in the history
This fixes an issue with __callee__ showing "(root)" at toplevel,
and since root can statically never contain a super call, the null
name should never be used that way either.
headius committed Jan 8, 2018
1 parent 87a0e73 commit 6908774
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/ir/Compiler.java
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ protected ScriptAndCode execute(final Ruby runtime, final IRScriptBody scope, Cl
@Override
public IRubyObject __file__(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) {
try {
return (IRubyObject) compiledHandle.invokeWithArguments(context, staticScope, self, IRubyObject.NULL_ARRAY, block, self.getMetaClass(), Interpreter.ROOT);
return (IRubyObject) compiledHandle.invokeWithArguments(context, staticScope, self, IRubyObject.NULL_ARRAY, block, self.getMetaClass(), null);
} catch (Throwable t) {
Helpers.throwException(t);
return null; // not reached
@@ -91,7 +91,7 @@ public IRubyObject load(ThreadContext context, IRubyObject self, boolean wrap) {
context.setCurrentVisibility(Visibility.PRIVATE);

try {
return (IRubyObject) compiledHandle.invokeWithArguments(context, staticScope, self, IRubyObject.NULL_ARRAY, Block.NULL_BLOCK, currModule, Interpreter.ROOT);
return (IRubyObject) compiledHandle.invokeWithArguments(context, staticScope, self, IRubyObject.NULL_ARRAY, Block.NULL_BLOCK, currModule, null);
} catch (IRBreakJump bj) {
throw IRException.BREAK_LocalJumpError.getException(context.runtime);
} catch (Throwable t) {

0 comments on commit 6908774

Please sign in to comment.