In JRuby 0.8.2, 0.8.3, and HEAD we had NameError as a subclass of ScriptError, instead of StandardError. As it turns out (and I had to study a bit for this) a bare rescue automatically rescues only StandardError descendents. Since we had NameError under the wrong parent, that shortcut syntax and bare rescue syntax were both broken. You'd think this would have come up sooner, no? Perhaps it was a 1.8 change, or perhaps someone just fat-fingered it some time in the past. Either way, it's fixed now.
While I was at it, I fixed a couple other exception issues:
- NoMemoryError was misnamed as NoMemError (though we don't actually raise it anywhere yet).
- FloatRangeError did not exist, so I added it. I did not see easy places to start raising it, but we'll need to do that. I add a FIXME for it.
- ZeroDivisionError did not exist, so I added it. I believe it is only raised for Fixnum and Bignum, since there's NaN for Float division by zero. I added the checks so it will now be thrown appropriately.
I committed a test for the exception hierarchy (checking that all appropriate exceptions are there and correctly rooted) to testException2 in JRuby. It could probably go in Rubicon, but I only tested the exceptions we actually support.
I committed zero-div tests directly to Rubicon, since they ought to be there.
Fun!
On 4/5/06, Nick Sieger <
[EMAIL PROTECTED]> wrote:
On 4/5/06, Charles O Nutter <[EMAIL PROTECTED]> wrote:My money is on a parser change.
It seems to parse ok, but it's as if the logic executed by the generated AST is not behaving the same way as C Ruby. Do you think the parser is mis-interpreting the _expression_ following "rescue" as some sort of exception list or var?
/Nick
--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com