Revision
536
Author
lsansonetti@apple.com
Date
2008-08-30 19:58:28 -0700 (Sat, 30 Aug 2008)

Log Message

set Symbol as a constant of Object, to make sure it can be re-opened. This fixes yaml serialization of Symbol objects.

Modified Paths

Diff

Modified: MacRuby/trunk/class.c (535 => 536)


--- MacRuby/trunk/class.c	2008-08-31 02:10:23 UTC (rev 535)
+++ MacRuby/trunk/class.c	2008-08-31 02:58:28 UTC (rev 536)
@@ -153,8 +153,9 @@
 	rb_define_object_special_methods(klass);
     }
 
-    if (name != NULL && rb_class_tbl != NULL) 
+    if (name != NULL && rb_class_tbl != NULL) {
 	st_insert(rb_class_tbl, (st_data_t)rb_intern(name), (st_data_t)klass);
+    }
 
     return klass;
 }
@@ -162,8 +163,7 @@
 VALUE
 rb_class_boot(VALUE super)
 {
-    VALUE klass = rb_objc_create_class(NULL, super);
-    return (VALUE)klass;
+    return rb_objc_create_class(NULL, super);
 }
 
 void

Modified: MacRuby/trunk/string.c (535 => 536)


--- MacRuby/trunk/string.c	2008-08-31 02:10:23 UTC (rev 535)
+++ MacRuby/trunk/string.c	2008-08-31 02:58:28 UTC (rev 536)
@@ -5389,6 +5389,8 @@
 
     /* rb_cSymbol is defined in parse.y because it's needed early */
     rb_set_class_path(rb_cSymbol, rb_cObject, "Symbol");
+    rb_const_set(rb_cObject, rb_intern("Symbol"), rb_cSymbol);
+
     rb_undef_alloc_func(rb_cSymbol);
     rb_undef_method(CLASS_OF(rb_cSymbol), "new");
     rb_define_singleton_method(rb_cSymbol, "all_symbols", rb_sym_all_symbols, 0); /* in parse.y */