[macruby-changes] [632] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Sat Sep 27 18:34:59 PDT 2008


Revision: 632
          http://trac.macosforge.org/projects/ruby/changeset/632
Author:   lsansonetti at apple.com
Date:     2008-09-27 18:34:59 -0700 (Sat, 27 Sep 2008)
Log Message:
-----------
fixed Module::class

Modified Paths:
--------------
    MacRuby/trunk/objc.m
    MacRuby/trunk/test/ruby/test_objc.rb

Modified: MacRuby/trunk/objc.m
===================================================================
--- MacRuby/trunk/objc.m	2008-09-27 04:43:26 UTC (rev 631)
+++ MacRuby/trunk/objc.m	2008-09-28 01:34:59 UTC (rev 632)
@@ -1133,7 +1133,7 @@
     else if (sel == @selector(class)) {
 	if (RCLASS_META(klass)) {
 	    /* because +[NSObject class] returns self */
-	    return rb_cClass;
+	    return RCLASS_MODULE(recv) ? rb_cModule : rb_cClass;
 	}
 	/* because the CF classes should be hidden */
 	else if (klass == rb_cCFString) {

Modified: MacRuby/trunk/test/ruby/test_objc.rb
===================================================================
--- MacRuby/trunk/test/ruby/test_objc.rb	2008-09-27 04:43:26 UTC (rev 631)
+++ MacRuby/trunk/test/ruby/test_objc.rb	2008-09-28 01:34:59 UTC (rev 632)
@@ -405,4 +405,11 @@
     o = TestCallSuperOverridenNew.new(42)
     assert_equal(42, o.x)
   end
+
+  def test_class_on_mods
+    assert_equal(Class, Object.class)
+    assert_equal(Module, Kernel.class)
+    assert_equal(Class, Class.new.class)
+    assert_equal(Module, Module.new.class)
+  end  
 end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080927/534b5098/attachment.html 


More information about the macruby-changes mailing list