]> git.saurik.com Git - cycript.git/commitdiff
Instance's toPointer() should return as CFTypeRef. v0.9.594
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 28 Aug 2016 20:29:56 +0000 (13:29 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 28 Aug 2016 20:29:56 +0000 (13:29 -0700)
ObjectiveC/Library.mm
sig/types.hpp

index d0d824f7c6d7f3d810a90db58998893bb9f3b00b..29d7be4bfa9bf7393381f739af815b860cafa80c 100644 (file)
@@ -2650,9 +2650,7 @@ static JSValueRef Instance_callAsFunction_toPointer(JSContextRef context, JSObje
     if (!CYJSValueIsNSObject(context, _this))
         return NULL;
     Instance *internal(reinterpret_cast<Instance *>(JSObjectGetPrivate(_this)));
-    // XXX: return CYMakePointer(context, internal->value_, sig::Object(class_getName(object_getClass(internal->value_))), NULL, object);
-    // XXX: return CYMakePointer(context, internal->value_, sig::Meta(), NULL, object);
-    return CYCastJSValue(context, reinterpret_cast<uintptr_t>(internal->value_));
+    return CYMakePointer(context, internal->value_, sig::Void(true), NULL, object);
 } CYCatch(NULL) return /*XXX*/ NULL; }
 
 static JSValueRef Instance_callAsFunction_toString(JSContextRef context, JSObjectRef object, JSObjectRef _this, size_t count, const JSValueRef arguments[], JSValueRef *exception) { CYTry {
index 30d8dbdd6106bfa1cfc3b6055124741830687417..78729c474efbdae513a32bc979f2789082ff1463 100644 (file)
@@ -104,6 +104,14 @@ struct Signature {
 struct Void :
     Type
 {
+    Void() {
+    }
+
+    Void(bool constant) {
+        if (constant)
+            flags |= JOC_TYPE_CONST;
+    }
+
     Void *Copy(CYPool &pool, const char *rename = NULL) const override;
 
     const char *Encode(CYPool &pool) const override;