Skip to content
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

unexpected break (from proc-closure) terminates process #4036

Open
kares opened this issue Jul 28, 2016 · 0 comments
Open

unexpected break (from proc-closure) terminates process #4036

kares opened this issue Jul 28, 2016 · 0 comments

Comments

@kares
Copy link
Member

kares commented Jul 28, 2016

MRI :

2.3.1 :001 >     proc = Proc.new { puts "HELLO"; break; puts "AGAIN" }
 => #<Proc:0x000000013f9958@(irb):1> 
2.3.1 :002 >     proc.call; puts "proc called"
HELLO
LocalJumpError: break from proc-closure
    from (irb):1:in `block in irb_binding'
    from (irb):2
    from /opt/local/rvm/rubies/ruby-2.3.1/bin/irb:11:in `<main>'
2.3.1 :003 > exit
jruby-1.7.24 :029 > proc = Proc.new { puts "HELLO"; break; puts "AGAIN" }
 => #<Proc:0xe874448@(irb):29> 
jruby-1.7.24 :030 > proc.call; puts "proc called"
HELLO
LocalJumpError: break from proc-closure
    from org/jruby/RubyProc.java:281:in `call'
    from (irb):30:in `evaluate'
    from org/jruby/RubyKernel.java:1079:in `eval'
    from org/jruby/RubyKernel.java:1479:in `loop'
    from org/jruby/RubyKernel.java:1242:in `catch'
    from org/jruby/RubyKernel.java:1242:in `catch'
    from /opt/local/rvm/rubies/jruby-1.7.24/bin/irb:13:in `(root)'
jruby-1.7.24 :031 > 
jruby-1.7.24 :032 >   exit

but 9K does not work the same :

jruby-9.1.2.0 :001 >     proc = Proc.new { puts "HELLO"; break; puts "AGAIN" }
 => #<Proc:0x31368b99@(irb):1> 
jruby-9.1.2.0 :002 >     proc.call; puts "proc called"
HELLO
LocalJumpError: unexpected break

... IRBreakJump bubbles up to Main#main's catch (Throwable) ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant