[macruby-changes] [2878] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Oct 21 15:53:57 PDT 2009


Revision: 2878
          http://trac.macosforge.org/projects/ruby/changeset/2878
Author:   eloy.de.enige at gmail.com
Date:     2009-10-21 15:53:56 -0700 (Wed, 21 Oct 2009)
Log Message:
-----------
Raise a NameError when trying to remove a method in the superclass.

Modified Paths:
--------------
    MacRuby/trunk/spec/frozen/tags/macruby/core/module/remove_method_tags.txt
    MacRuby/trunk/vm_method.c

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/module/remove_method_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/module/remove_method_tags.txt	2009-10-21 21:23:16 UTC (rev 2877)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/module/remove_method_tags.txt	2009-10-21 22:53:56 UTC (rev 2878)
@@ -1,2 +1 @@
 fails:Module#remove_method removes method from subclass, but not parent
-fails:Module#remove_method raises a NameError when attempting to remove method further up the inheritance tree

Modified: MacRuby/trunk/vm_method.c
===================================================================
--- MacRuby/trunk/vm_method.c	2009-10-21 21:23:16 UTC (rev 2877)
+++ MacRuby/trunk/vm_method.c	2009-10-21 22:53:56 UTC (rev 2878)
@@ -139,7 +139,8 @@
 	    m = class_getInstanceMethod((Class)klass, sel);
 	}
     }
-    if (m == NULL) {
+    if (m == NULL
+        || class_getInstanceMethod((Class)RCLASS_SUPER(klass), sel) == m) {
 	rb_name_error(mid, "method `%s' not defined in %s",
 		      rb_id2name(mid), rb_class2name(klass));
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091021/371f6a4c/attachment.html>


More information about the macruby-changes mailing list