Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: JRuby 1.0.0RC1, JRuby 1.0.0RC2
-
Fix Version/s: JRuby 2
-
Component/s: Interpreter
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
For code:
eval "next 1"
Ruby output:
-e:1: (eval):1: unexpected next (LocalJumpError)
JRuby output:
Exception in thread "main" org.jruby.exceptions.JumpException
Issue Links
- is related to
-
JRUBY-966
Various issues with LocalJumpError not being created early enough
-
The big problem here, as explained to me by Tom, is that we propagate what would be LocalJumpErrors as though they're just normal JumpExceptions. Because they're JumpExceptions instead of RaiseExceptions, they don't get caught by rescue blocks.
There are two potential fixes for this I can see:
I believe the former is the correct route, and it's likely the only way that MRI could be doing this. So we need to look at these cases one by one and determine where and when it is inappropriate to encounter them, raising a LocalJumpError instead of a JumpException in those cases.
Bumping to 1.0, since we're the only ones that have reported this. But we should fix for 1.0.