That's an interesting one; if it's not supported now it may require a parser change to wrap the specified code in an implicit begin block. You could look into how RescueNode is handled, but it's pretty deep stuff.

My money is on a parser change.

On 4/5/06, Nick Sieger <[EMAIL PROTECTED]> wrote:
Some Rails code uses a shorthand rescue syntax that JRuby does not seem to appreciate.  Witness the following tidbit:

def dummy(obj)
  obj.missing_method rescue "missing_method"
end

puts dummy("hello")

In C Ruby:

[20:57:24][~/Projects/jruby]$ ruby test/testRescue.rb
missing_method

In JRuby:

[20:57:30][~/Projects/jruby]$ jruby test/testRescue.rb
test/testRescue.rb:2:in `method_missing': undefined method `missing_method' for "hello":String (NoMethodError)
        from test/testRescue.rb:2:in `dummy'
        from test/testRescue.rb:6

Any ideas of where to look to attempt to fix this?  I'll start digging in, but the Java side of JRuby is still fresh for me so I haven't found where yet...

/Nick



--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com

Reply via email to