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

ruby-changes:40978

From: nobu <ko1@a...>
Date: Sat, 12 Dec 2015 18:51:44 +0900 (JST)
Subject: [ruby-changes:40978] nobu:r53057 (trunk): vm_eval.c: hook after method_missing

nobu	2015-12-12 18:51:30 +0900 (Sat, 12 Dec 2015)

  New Revision: 53057

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

  Log:
    vm_eval.c: hook after method_missing
    
    * vm_eval.c (rb_check_funcall_with_hook): call hook after
      method_missing call when missing.

  Modified files:
    trunk/vm_eval.c
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 53056)
+++ vm_eval.c	(revision 53057)
@@ -483,9 +483,10 @@ rb_check_funcall_with_hook(VALUE recv, I https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L483
 
     me = rb_search_method_entry(recv, mid);
     if (!check_funcall_callable(th, me)) {
-	(*hook)(FALSE, recv, mid, argc, argv, arg);
-	return check_funcall_missing(th, klass, recv, mid, argc, argv,
-				     respond, Qundef);
+	VALUE ret = check_funcall_missing(th, klass, recv, mid, argc, argv,
+					  respond, Qundef);
+	(*hook)(ret != Qundef, recv, mid, argc, argv, arg);
+	return ret;
     }
     stack_check();
     (*hook)(TRUE, recv, mid, argc, argv, arg);

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

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