![]() |
|
|
Issue Type:
|
Bug
|
Affects Versions:
|
JRuby 1.7.0.pre1 |
Assignee:
|
Unassigned |
Components:
|
Core Classes/Modules |
Created:
|
30/May/12 1:25 PM
|
Description:
|
It seems JRuby is the victim of bad documentation again. This time it's the Exception#== method which says, "If obj is not an Exception, returns false." Except that statement is false.
Based on the source code in error.c (lines 705 ff.) the obj can, in fact, be something other than an Exception IF it implements the :message and :backtrace methods AND they are each equal to the receiver's :message and :backtrace methods. Here is some sample code that demonstrates it:
Personally I don't really understand why MRI chose to do this, but there you have it.
Courtesy of berger_spec.
|
Environment:
|
jruby 1.7.0.preview1 (ruby-1.9.3-p203) (2012-05-19 00c8c98) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_31) [darwin-x86_64-java]
|
Project:
|
JRuby
|
Priority:
|
Minor
|
Reporter:
|
Daniel Berger
|
|
|
|
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
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