[macruby-changes] [833] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Mon Mar 2 23:19:14 PST 2009
Revision: 833
http://trac.macosforge.org/projects/ruby/changeset/833
Author: lsansonetti at apple.com
Date: 2009-03-02 23:19:13 -0800 (Mon, 02 Mar 2009)
Log Message:
-----------
fixed a bug when trying to change a Kernel method visibility
Modified Paths:
--------------
MacRuby/trunk/test/ruby/test_objc.rb
MacRuby/trunk/vm_method.c
Modified: MacRuby/trunk/test/ruby/test_objc.rb
===================================================================
--- MacRuby/trunk/test/ruby/test_objc.rb 2009-03-02 22:06:19 UTC (rev 832)
+++ MacRuby/trunk/test/ruby/test_objc.rb 2009-03-03 07:19:13 UTC (rev 833)
@@ -508,4 +508,12 @@
assert_equal('i', ms.getArgumentTypeAtIndex(2))
assert_equal('i', ms.getArgumentTypeAtIndex(3))
end
+
+ module Kernel
+ def foo; 42; end
+ private :foo
+ end
+ def test_private_kernel_method
+ assert_equal(42, foo)
+ end
end
Modified: MacRuby/trunk/vm_method.c
===================================================================
--- MacRuby/trunk/vm_method.c 2009-03-02 22:06:19 UTC (rev 832)
+++ MacRuby/trunk/vm_method.c 2009-03-03 07:19:13 UTC (rev 833)
@@ -479,8 +479,15 @@
? rb_cObject : klass;
}
else {
- origin = rb_method_node(RCLASS_SUPER(klass), name) == fbody
- ? RCLASS_SUPER(klass) : klass;
+ if (klass == rb_mKernel) {
+ // This is a special case, since Kernel inherits of NSObject, and that
+ // Kernel is mixed into NSObject.
+ origin = rb_mKernel;
+ }
+ else {
+ origin = rb_method_node(RCLASS_SUPER(klass), name) == fbody
+ ? RCLASS_SUPER(klass) : klass;
+ }
}
if (fbody == NULL) {
rb_print_undef(klass, name, 0);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090302/cb68d4ce/attachment-0001.html>
More information about the macruby-changes
mailing list