Revision: 2833 http://trac.macosforge.org/projects/ruby/changeset/2833 Author: lsansonetti@apple.com Date: 2009-10-16 14:02:39 -0700 (Fri, 16 Oct 2009) Log Message: ----------- fixed a bug where ivars would not work for some builtin subclasses Modified Paths: -------------- MacRuby/trunk/variable.c Modified: MacRuby/trunk/variable.c =================================================================== --- MacRuby/trunk/variable.c 2009-10-16 20:57:56 UTC (rev 2832) +++ MacRuby/trunk/variable.c 2009-10-16 21:02:39 UTC (rev 2833) @@ -839,6 +839,7 @@ entry1->var = entry2->var; } +// TODO: should use an associative reference instead. static CFMutableDictionaryRef generic_iv_dict = NULL; static VALUE @@ -1076,10 +1077,7 @@ return generic_ivar_get(obj, id, warn); default: - if (FL_TEST(obj, FL_EXIVAR) || rb_special_const_p(obj)) { - return generic_ivar_get(obj, id, warn); - } - break; + return generic_ivar_get(obj, id, warn); } if (warn) { rb_warning("instance variable %s not initialized", rb_id2name(id)); @@ -1142,13 +1140,11 @@ break; case T_NATIVE: - rb_objc_flag_set((const void *)obj, FL_EXIVAR, true); generic_ivar_set(obj, id, val); break; default: generic_ivar_set(obj, id, val); - FL_SET(obj, FL_EXIVAR); break; } return val; @@ -1199,10 +1195,7 @@ return generic_ivar_defined(obj, id); default: - if (FL_TEST(obj, FL_EXIVAR) || rb_special_const_p(obj)) { - return generic_ivar_defined(obj, id); - } - break; + return generic_ivar_defined(obj, id); } return Qfalse; } @@ -1232,9 +1225,6 @@ case T_NATIVE: goto generic; } - if (!FL_TEST(obj, FL_EXIVAR) && !rb_special_const_p(obj)) { - return; - } generic: if (generic_iv_dict != NULL) { CFDictionaryRef obj_dict;
participants (1)
-
source_changes@macosforge.org