Skip to content

Commit

Permalink
Added minor debugging output for breaks and non-local returns.
Browse files Browse the repository at this point in the history
  • Loading branch information
subbuss committed Sep 17, 2014
1 parent 57222ee commit e79c0ea
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -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;
Expand Down Expand Up @@ -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?
Expand Down

0 comments on commit e79c0ea

Please sign in to comment.