Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Incomplete
-
Affects Version/s: JRuby 1.1.3, JRuby 1.4
-
Fix Version/s: None
-
Component/s: Miscellaneous
-
Labels:None
-
Number of attachments :
Description
So it turns out that the test_local_jump_error test has been running, but not actually running. I discovered it when I made various fixes and improvements to non-local flow control that appear to have made it a hard failure:
Before:
~/NetBeansProjects/jruby ➔ jruby -X-C test/test_local_jump_error.rb Loaded suite test/test_local_jump_error Started Finished in 0.062 seconds. 0 tests, 0 assertions, 0 failures, 0 errors
After:
~/NetBeansProjects/jruby ➔ jruby -X-C test/test_local_jump_error.rb Loaded suite test/test_local_jump_error Started :1: break from proc-closure (LocalJumpError)
So it wasn't working before either. I'm going to disable the test, and I'm filing this bug.
The only way I can see to make this and other LJE cases work right would be to inspect the frame stack and see if the target frame/jumpTarget is still there, but since we preallocate frames and jump targets it would end up being wrong. Also look at this return case:
Not rescuable:
def foo
bar(Proc.call {return})
end
def bar(proc)
begin
proc.call
rescue LocalJumpError
puts 'here'
end
end
foo # no output
Rescuable:
def foo
Proc.call {return}
end
def bar(proc)
begin
proc.call
rescue LocalJumpError
puts 'here'
end
end
bar(foo) # output 'here'
So the return is rescuable only in the case where it has escaped from its original containing method. Damned frustrating.
Issue Links
- is duplicated by
-
JRUBY-4239
LocalJumpError not thrown
-
- relates to
-
JRUBY-4262
Weird Proc test makes JRuby to skip the rest of the tests completely
-