From: Jay Freeman (saurik) Date: Thu, 13 Sep 2012 08:52:14 +0000 (-0700) Subject: Fix @bool .valueOf() to return boolean, not number. X-Git-Tag: v0.9.459~6 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/77f56624a75e39b19c72e6076e46e230ce3abbb1?ds=inline Fix @bool .valueOf() to return boolean, not number. --- diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index 1749d88..a113779 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -959,7 +959,7 @@ NSObject *CYCopyNSObject(apr_pool_t *pool, JSContextRef context, JSValueRef valu } - (JSValueRef) cy$valueOfInContext:(JSContextRef)context { CYObjectiveTry_(context) { - return [self cy$JSType] != kJSTypeBoolean ? CYCastJSValue(context, [self doubleValue]) : CYCastJSValue(context, [self boolValue]); + return [self cy$JSType] != kJSTypeBoolean ? CYCastJSValue(context, [self doubleValue]) : CYCastJSValue(context, static_cast([self boolValue])); } CYObjectiveCatch } @end