]> git.saurik.com Git - cycript.git/blobdiff - ObjectiveC/Library.mm
The objc_registerClassPair hack is not even there.
[cycript.git] / ObjectiveC / Library.mm
index 7b0785ad6b4de079eef39b38282f06db85f8d2f8..7b62f702d3679f55394cf50ef8793ba76197685c 100644 (file)
@@ -1549,9 +1549,12 @@ static JSObjectRef CYMakeMessage(JSContextRef context, SEL sel, IMP imp, const c
     return JSObjectMake(context, Message_, internal);
 }
 
-static IMP CYMakeMessage(JSContextRef context, JSValueRef value, const char *type) {
+static IMP CYMakeMessage(JSContextRef context, JSValueRef value, const char *encoding) {
     JSObjectRef function(CYCastJSObject(context, value));
-    Closure_privateData *internal(CYMakeFunctor_(context, function, type, &MessageClosure_));
+    CYPool pool;
+    sig::Signature signature;
+    sig::Parse(pool, &signature, encoding, &Structor_);
+    Closure_privateData *internal(CYMakeFunctor_(context, function, signature, &MessageClosure_));
     // XXX: see notes in Library.cpp about needing to leak
     return reinterpret_cast<IMP>(internal->GetValue());
 }
@@ -2647,10 +2650,13 @@ static JSValueRef Selector_callAsFunction_type(JSContextRef context, JSObjectRef
     else
         method = NULL;
 
-    if (const char *type = CYPoolTypeEncoding(pool, context, sel, method))
-        return CYCastJSValue(context, CYJSString(type));
+    const char *encoding(CYPoolTypeEncoding(pool, context, sel, method));
+    if (encoding == NULL)
+        return CYJSNull(context);
 
-    return CYJSNull(context);
+    sig::Signature signature;
+    sig::Parse(pool, &signature, encoding, &Structor_);
+    return CYMakeType(context, &signature);
 } CYCatch(NULL) }
 
 static JSStaticValue Selector_staticValues[2] = {
@@ -2924,10 +2930,6 @@ void CYObjectiveC_SetupContext(JSContextRef context) { CYPoolTry {
     JSObjectRef box(JSObjectMakeFunctionWithCallback(context, CYJSString("box"), &Instance_box_callAsFunction));
     CYSetProperty(context, Instance, CYJSString("box"), box);
 
-#if defined(__APPLE__) && defined(__arm__) && 0
-    CYSetProperty(context, all, CYJSString("objc_registerClassPair"), &objc_registerClassPair_, kJSPropertyAttributeDontEnum);
-#endif
-
 #ifdef __APPLE__
     CYSetProperty(context, all, CYJSString("choose"), &choose, kJSPropertyAttributeDontEnum);
 #endif