class << self doesn't preserve the given block
----------------------------------------------
Key: JRUBY-4963
URL: http://jira.codehaus.org/browse/JRUBY-4963
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.5
Environment: Snow Leopard
Reporter: Magnus Holm
Assignee: Thomas E Enebo
$ ruby -v
jruby 1.5.0 (ruby 1.8.7 patchlevel 249) (2010-05-12 6769999) (Java
HotSpot(TM) 64-Bit Server VM 1.6.0_20) [x86_64-java]
$ cat bug.rb
def hello
class << self
yield
end
end
p hello { 123 }
$ ruby bug.rb
:1:in `hello': yield called out of block (LocalJumpError)
from bug.rb:7
Works fine in MRI 1.8.7 and 1.9.2. Fails in JRuby, 1.9.1 and Rubinius).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email