[前][次][番号順一覧][スレッド一覧]

ruby-changes:14140

From: matz <ko1@a...>
Date: Sat, 28 Nov 2009 09:30:21 +0900 (JST)
Subject: [ruby-changes:14140] Ruby:r25954 (trunk): * vm_eval.c (check_funcall_failed): should rescue user raised

matz	2009-11-28 09:26:27 +0900 (Sat, 28 Nov 2009)

  New Revision: 25954

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25954

  Log:
    * vm_eval.c (check_funcall_failed): should rescue user raised
      NoMethodError.  rescue all NoMethodError if receiver does not
      respond to the method name.  [ruby-dev:39796]

  Modified files:
    trunk/ChangeLog
    trunk/vm_eval.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 25953)
+++ ChangeLog	(revision 25954)
@@ -1,3 +1,9 @@
+Sat Nov 28 09:05:53 2009  Yukihiro Matsumoto  <matz@r...>
+
+	* vm_eval.c (check_funcall_failed): should rescue user raised
+	  NoMethodError.  rescue all NoMethodError if receiver does not
+	  respond to the method name.  [ruby-dev:39796]
+
 Thu Nov 26 21:14:30 2009  Yuki Sonoda (Yugui)  <yugui@y...>
 
 	* test/ruby/test_complex.rb (@unify): fix the detection if math
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 25953)
+++ vm_eval.c	(revision 25954)
@@ -255,10 +255,9 @@
 static VALUE
 check_funcall_failed(struct rescue_funcall_args *args, VALUE e)
 {
-    VALUE sym = rb_funcall(e, rb_intern("name"), 0, 0);
-
-    if (args->sym != sym)
+    if (rb_respond_to(args->recv, args->sym)) {
 	rb_exc_raise(e);
+    }
     return Qundef;
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]