[macruby-changes] [1481] MacRuby/branches/experimental/roxor.cpp
source_changes at macosforge.org
source_changes at macosforge.org
Thu Apr 23 17:42:31 PDT 2009
Revision: 1481
http://trac.macosforge.org/projects/ruby/changeset/1481
Author: lsansonetti at apple.com
Date: 2009-04-23 17:42:31 -0700 (Thu, 23 Apr 2009)
Log Message:
-----------
when looking for a BS method signature, look through the class hierarchy and not only the given class
Modified Paths:
--------------
MacRuby/branches/experimental/roxor.cpp
Modified: MacRuby/branches/experimental/roxor.cpp
===================================================================
--- MacRuby/branches/experimental/roxor.cpp 2009-04-23 23:43:48 UTC (rev 1480)
+++ MacRuby/branches/experimental/roxor.cpp 2009-04-24 00:42:31 UTC (rev 1481)
@@ -8672,21 +8672,26 @@
class_isMetaClass(klass) ? bs_classes_class_methods
: bs_classes_instance_methods;
- std::map<std::string, std::map<SEL, bs_element_method_t *> *>::iterator
- iter = map.find(class_getName(klass));
+ do {
+ std::map<std::string,
+ std::map<SEL, bs_element_method_t *> *>::iterator iter =
+ map.find(class_getName(klass));
- if (iter == map.end()) {
- return NULL;
- }
+ if (iter != map.end()) {
+ std::map<SEL, bs_element_method_t *> *map2 = iter->second;
+ std::map<SEL, bs_element_method_t *>::iterator iter2 =
+ map2->find(sel);
- std::map<SEL, bs_element_method_t *> *map2 = iter->second;
- std::map<SEL, bs_element_method_t *>::iterator iter2 = map2->find(sel);
+ if (iter2 != map2->end()) {
+ return iter2->second;
+ }
+ }
- if (iter2 == map2->end()) {
- return NULL;
+ klass = class_getSuperclass(klass);
}
+ while (klass != NULL);
- return iter2->second;
+ return NULL;
}
inline rb_vm_bs_boxed_t *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090423/1269af0e/attachment-0001.html>
More information about the macruby-changes
mailing list