Laurent Sansonetti
lsans****@apple*****
Thu Jun 8 09:30:42 JST 2006
On Jun 7, 2006, at 11:14 PM, Jonathan Paisley wrote: >> >> Apparently rb_class2name() calls rb_class_real() on the class and >> this picks the right class, rb_mod_name() does not do that. Also, >> rb_class2name() returns us a C string that we don't have to >> convert, and according to the code it does more logic if classname >> () returns nil, so I believe the patch is good (I applied it in >> the branch). > > Replacement code looks reasonable. > > The reason for rb_mod_name failing is that it determines the name > by recursively traversing the Constants defined on Object and below > in order to find the class name. I don't think those dynamic > subclasses every get assigned to a constant (e.g., OSX::NSArray), > so it fails. Not sure this was the cause, as the NSCFArray wrapper class was assigned to a OSX:: constant, and that just calling rb_mod_name (rb_class_real(klass)) did work. So this is really this rb_class_real () call (indirectly called by rb_class2name()) that fixed this. Laurent