+static objc_property_t CYFindProperty(CYPool &pool, Class _class, const char *name) {
+ if (_class == Nil)
+ return NULL;
+ if (objc_property_t property = class_getProperty(_class, name))
+ return property;
+ return NULL;
+
+ /* // XXX: I don't think any of this is required
+ unsigned int count;
+ Protocol **protocols(class_copyProtocolList(_class, &count));
+ // XXX: just implement a scope guard already :/
+ pool.atexit(free, protocols);
+
+ for (unsigned int i(0); i != count; ++i)
+ if (objc_property_t property = protocol_getProperty(protocols[i], name, true, true))
+ return property;
+
+ return CYFindProperty(pool, class_getSuperclass(_class), name); */
+}
+
+static JSValueRef Constructor_getProperty_$cyi(JSContextRef context, JSObjectRef object, JSStringRef property, JSValueRef *exception) { CYTry {
+ auto internal(CYPrivate<Constructor>::Get(context, object));
+ return CYPrivate<Interior>::Make(context, internal->value_, context, object);
+} CYCatch(NULL) }
+
+static bool Constructor_hasProperty(JSContextRef context, JSObjectRef object, JSStringRef property) {
+ auto internal(CYPrivate<Constructor>::Get(context, object));
+ Class _class(object_getClass(internal->value_));
+ if (!CYHasImplicitProperties(context, _class))
+ return false;
+ CYPool pool;
+ if (SEL sel = sel_getUid(CYPoolCString(pool, context, property)))
+ if (CYImplements(internal->value_, _class, sel, true))
+ return true;
+ return false;
+}
+
+static JSValueRef Constructor_getProperty(JSContextRef context, JSObjectRef object, JSStringRef property, JSValueRef *exception) { CYTry {
+ auto internal(CYPrivate<Constructor>::Get(context, object));
+ Class _class(object_getClass(internal->value_));
+ if (!CYHasImplicitProperties(context, _class))
+ return NULL;
+ CYPool pool;
+ if (SEL sel = sel_getUid(CYPoolCString(pool, context, property)))
+ if (CYImplements(internal->value_, _class, sel, true))
+ return CYSendMessage(pool, context, internal->value_, NULL, sel, 0, NULL, false);
+ return NULL;
+} CYCatch(NULL) }
+