]> git.saurik.com Git - cycript.git/blobdiff - ObjectiveC/Library.mm
Fix the name of getProperty for Instance.prototype.
[cycript.git] / ObjectiveC / Library.mm
index 2cb81b741ca674cac1f28001ff2dc166d59eaf6d..c43957e8d09623efb3f33517e3423a54618a280d 100644 (file)
@@ -252,6 +252,7 @@ static JSClassRef ObjectiveC_Images_;
 #ifdef __APPLE__
 static Class NSCFBoolean_;
 static Class NSCFType_;
+static Class NSGenericDeallocHandler_;
 static Class NSMessageBuilder_;
 static Class NSZombie_;
 #else
@@ -419,7 +420,7 @@ NSString *CYCastNSCYON(id value) {
             else if (_class == NSZombie_)
                 string = [NSString stringWithFormat:@"<_NSZombie_: %p>", value];
             // XXX: frowny /in/ the pants
-            else if (value == NSMessageBuilder_ || value == Object_)
+            else if (value == NSGenericDeallocHandler_ || value == NSMessageBuilder_ || value == Object_)
                 string = nil;
 #endif
             else
@@ -2220,7 +2221,7 @@ static JSValueRef Instance_getProperty_constructor(JSContextRef context, JSObjec
     return Instance::Make(context, (id) object_getClass(internal->GetValue()));
 }
 
-static JSValueRef Instance_getProperty_protocol(JSContextRef context, JSObjectRef object, JSStringRef property, JSValueRef *exception) { CYTry {
+static JSValueRef Instance_getProperty_prototype(JSContextRef context, JSObjectRef object, JSStringRef property, JSValueRef *exception) { CYTry {
     Instance *internal(reinterpret_cast<Instance *>(JSObjectGetPrivate(object)));
     id self(internal->GetValue());
     if (!CYIsClass(self))
@@ -2343,7 +2344,7 @@ static JSStaticValue Selector_staticValues[2] = {
 static JSStaticValue Instance_staticValues[5] = {
     {"constructor", &Instance_getProperty_constructor, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete},
     {"messages", &Instance_getProperty_messages, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete},
-    {"prototype", &Instance_getProperty_protocol, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete},
+    {"prototype", &Instance_getProperty_prototype, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete},
     {"value", &CYValue_getProperty_value, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete},
     {NULL, NULL, NULL, 0}
 };
@@ -2386,6 +2387,7 @@ void CYObjectiveC_Initialize() { /*XXX*/ JSContextRef context(NULL); CYPoolTry {
 #ifdef __APPLE__
     NSCFBoolean_ = objc_getClass("NSCFBoolean");
     NSCFType_ = objc_getClass("NSCFType");
+    NSGenericDeallocHandler_ = objc_getClass("__NSGenericDeallocHandler");
     NSMessageBuilder_ = objc_getClass("NSMessageBuilder");
     NSZombie_ = objc_getClass("_NSZombie_");
 #else