From: Jay Freeman (saurik) Date: Sun, 28 Aug 2016 20:29:56 +0000 (-0700) Subject: Instance's toPointer() should return as CFTypeRef. X-Git-Tag: v0.9.594^0 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/2c4a8bb6222b88ff96fbf25372179646ce15f706?hp=13bcb0b112eb318b0da585f713c2ea5a69d47573 Instance's toPointer() should return as CFTypeRef. --- diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index d0d824f..29d7be4 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -2650,9 +2650,7 @@ static JSValueRef Instance_callAsFunction_toPointer(JSContextRef context, JSObje if (!CYJSValueIsNSObject(context, _this)) return NULL; Instance *internal(reinterpret_cast(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(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 { diff --git a/sig/types.hpp b/sig/types.hpp index 30d8dbd..78729c4 100644 --- a/sig/types.hpp +++ b/sig/types.hpp @@ -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;