-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
break within a block throws LocalJumpError in JRuby but succeeds in MRI Ruby #4369
Comments
I'm surprised this works on MRI. I was under the impression that break can never escape a lambda body. Confirmed on master:
Note that it works fine if you change the This may be an IR thing or just a Proc thing. |
This works correctly in JRuby 1.7.25. |
The commit that was possibly regressed was between 1.7.19 and 1.7.20.
|
I think this is the commit that originally fixed it, but then the code was refactored for 9k. e61b737 |
jruby/core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java Lines 205 to 207 in 9dfb955
|
I cannot find any case where lambda cannot contain a break. If someone can chime in on an error case it would be great. |
Kill the LocalJumpError logic for break in lambda. Fixes #4369.
Environment
Test Code
Expected Behavior
I expect the above code to print
a
to the console.Actual Behavior
MRI Ruby 2.3.0
JRuby behavior in 9.1.6.0, 9.1.5.0 and 1.7.19 is to throw a LocalJumpError:
The text was updated successfully, but these errors were encountered: