[macruby-changes] [2572] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Sep 18 22:19:46 PDT 2009


Revision: 2572
          http://trac.macosforge.org/projects/ruby/changeset/2572
Author:   vincent.isambart at gmail.com
Date:     2009-09-18 22:19:43 -0700 (Fri, 18 Sep 2009)
Log Message:
-----------
fixed Matt's bug (and his test case too) and added a new failing test

Modified Paths:
--------------
    MacRuby/trunk/class.c
    MacRuby/trunk/test_vm/module.rb

Modified: MacRuby/trunk/class.c
===================================================================
--- MacRuby/trunk/class.c	2009-09-19 03:48:57 UTC (rev 2571)
+++ MacRuby/trunk/class.c	2009-09-19 05:19:43 UTC (rev 2572)
@@ -492,7 +492,7 @@
 
     mdl = rb_objc_alloc_class(id == 0 ? NULL : rb_id2name(id), rb_cObject, T_MODULE, rb_cModule);
 
-    if (rb_mKernel != 0) {
+    if ((rb_mKernel != 0) && (id == 0)) {
 	/* because Module#initialize can accept a block */
 	rb_objc_define_method(*(VALUE *)mdl, "initialize", rb_mod_initialize, 0);
     }

Modified: MacRuby/trunk/test_vm/module.rb
===================================================================
--- MacRuby/trunk/test_vm/module.rb	2009-09-19 03:48:57 UTC (rev 2571)
+++ MacRuby/trunk/test_vm/module.rb	2009-09-19 05:19:43 UTC (rev 2572)
@@ -30,5 +30,18 @@
       42
     end
   end
-  Foo.new.bar
+  class A
+    include Foo
+  end
+  p A.new.bar
 }
+
+assert ':ok', %{
+  module M; end
+  begin
+    M.new
+    p :ko
+  rescue NoMethodError
+    p :ok
+  end
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090918/99a8371f/attachment.html>


More information about the macruby-changes mailing list