From 6d056e3332914537d12f9a50610d1c76811f94ee Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 3 Jun 2012 12:29:26 -0700 Subject: [PATCH] Match up Instance_callAsFunction_{toString,valueOf}. --- ObjectiveC/Library.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.45.2