-
-
Save headius/a64568fbc97c86cbad6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/src/main/java/org/jruby/RubyProc.java b/core/src/main/java/org/jruby/RubyProc.java | |
index d520c2a..94518c7 100644 | |
--- a/core/src/main/java/org/jruby/RubyProc.java | |
+++ b/core/src/main/java/org/jruby/RubyProc.java | |
@@ -298,15 +298,17 @@ public class RubyProc extends RubyObject implements DataType { | |
} | |
private IRubyObject handleBreakJump(Ruby runtime, Block newBlock, JumpException.BreakJump bj, int jumpTarget) { | |
- switch(newBlock.type) { | |
- case LAMBDA: | |
- if (bj.getTarget() == jumpTarget) return (IRubyObject) bj.getValue(); | |
- | |
- throw runtime.newLocalJumpError(RubyLocalJumpError.Reason.BREAK, (IRubyObject)bj.getValue(), "unexpected break"); | |
- case PROC: | |
- if (newBlock.isEscaped()) throw runtime.newLocalJumpError(RubyLocalJumpError.Reason.BREAK, (IRubyObject)bj.getValue(), "break from proc-closure"); | |
+ if (bj.getTarget() == jumpTarget) { | |
+ switch (newBlock.type) { | |
+ case LAMBDA: | |
+ return (IRubyObject) bj.getValue(); | |
+ case PROC: | |
+ if (newBlock.isEscaped()) { | |
+ throw runtime.newLocalJumpError(RubyLocalJumpError.Reason.BREAK, (IRubyObject) bj.getValue(), "break from proc-closure"); | |
+ } | |
+ } | |
} | |
- | |
+ | |
throw bj; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment