Skip to content
Permalink
Browse files
Added minor debugging output for breaks and non-local returns.
  • Loading branch information
subbuss committed Sep 17, 2014
1 parent 57222ee commit e79c0ea2dff9d907ea795a6d3e1e67ba3f15814b
Showing 1 changed file with 5 additions and 1 deletion.
@@ -105,7 +105,10 @@ public static IRubyObject handleNonlocalReturn(StaticScope scope, DynamicScope d
IRReturnJump rj = (IRReturnJump)rjExc;

// - If we are in a lambda or if we are in the method scope we are supposed to return from, stop propagating
if (inNonMethodBodyLambda((IRStaticScope)scope, blockType) || (rj.methodToReturnFrom == dynScope)) return (IRubyObject) rj.returnValue;
if (inNonMethodBodyLambda((IRStaticScope)scope, blockType) || (rj.methodToReturnFrom == dynScope)) {
if (isDebug()) System.out.println("---> Non-local Return reached target in scope: " + dynScope);
return (IRubyObject) rj.returnValue;
}

// - If not, Just pass it along!
throw rj;
@@ -171,6 +174,7 @@ public static IRubyObject handlePropagatedBreak(ThreadContext context, DynamicSc
}
} else if (bj.scopeToReturnTo == dynScope) {
// Done!! Hurray!
if (isDebug()) System.out.println("---> Break reached target in scope: " + dynScope);
return bj.breakValue;
/* ---------------------------------------------------------------
* FIXME: Puzzled .. Why is this not needed?

0 comments on commit e79c0ea

Please sign in to comment.