From: Jay Freeman (saurik) Date: Sun, 3 Jun 2012 19:29:26 +0000 (-0700) Subject: Match up Instance_callAsFunction_{toString,valueOf}. X-Git-Tag: v0.9.455~17 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/6d056e3332914537d12f9a50610d1c76811f94ee?ds=sidebyside Match up Instance_callAsFunction_{toString,valueOf}. --- diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index 6ebb788..9739099 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -2302,14 +2302,14 @@ static JSValueRef Instance_callAsFunction_toString(JSContextRef context, JSObjec return NULL; Instance *internal(reinterpret_cast(JSObjectGetPrivate(_this))); - id value(internal->GetValue()); + if (value == nil) return CYCastJSValue(context, "nil"); CYPoolTry { // XXX: this seems like a stupid implementation; what if it crashes? why not use the CYONifier backend? - return CYCastJSValue(context, CYJSString(context, [internal->GetValue() description])); + return CYCastJSValue(context, CYJSString(context, [value description])); } CYPoolCatch(NULL) } CYCatch return /*XXX*/ NULL; }