ruby-changes:22249
From: naruse <ko1@a...>
Date: Sat, 14 Jan 2012 08:42:04 +0900 (JST)
Subject: [ruby-changes:22249] naruse:r34298 (trunk): Revert "* error.c (exc_equal): try implicit conversion for delegator."
naruse 2012-01-14 08:41:55 +0900 (Sat, 14 Jan 2012) New Revision: 34298 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34298 Log: Revert "* error.c (exc_equal): try implicit conversion for delegator." This reverts commit r34291 because it breaks objects whose "exception" method doesn't allow no argument like XMLRPC::FaultException class. To reproduce: `RuntimeError.new == XMLRPC::FaultException`. [ruby-core:41979] [Bug #5865] Modified files: trunk/ChangeLog trunk/error.c trunk/test/ruby/test_exception.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 34297) +++ ChangeLog (revision 34298) @@ -18,11 +18,6 @@ * load.c (load_unlock): update loading table at once. -Fri Jan 13 16:44:45 2012 Nobuyoshi Nakada <nobu@r...> - - * error.c (exc_equal): try implicit conversion for delegator. - [ruby-core:41979] [Bug #5865] - Fri Jan 13 03:46:53 2012 Akinori MUSHA <knu@i...> * lib/shellwords.rb (Shellwords#shellescape): shellescape() now Index: error.c =================================================================== --- error.c (revision 34297) +++ error.c (revision 34298) @@ -732,14 +732,10 @@ CONST_ID(id_mesg, "mesg"); if (rb_obj_class(exc) != rb_obj_class(obj)) { - ID id_exception, id_message, id_backtrace; - CONST_ID(id_exception, "exception"); + ID id_message, id_backtrace; CONST_ID(id_message, "message"); CONST_ID(id_backtrace, "backtrace"); - obj = rb_check_funcall(obj, id_exception, 0, 0); - if (obj == Qundef) return Qfalse; - if (rb_obj_class(exc) != rb_obj_class(obj)) return Qfalse; mesg = rb_check_funcall(obj, id_message, 0, 0); if (mesg == Qundef) return Qfalse; backtrace = rb_check_funcall(obj, id_backtrace, 0, 0); Index: test/ruby/test_exception.rb =================================================================== --- test/ruby/test_exception.rb (revision 34297) +++ test/ruby/test_exception.rb (revision 34298) @@ -380,10 +380,4 @@ load(t.path) end end - - def test_equal - bug5865 = '[ruby-core:41979]' - assert_equal(RuntimeError.new("a"), RuntimeError.new("a"), bug5865) - assert_not_equal(RuntimeError.new("a"), StandardError.new("a"), bug5865) - end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/