]> git.saurik.com Git - cycript.git/commitdiff
Fix @bool .valueOf() to return boolean, not number.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 13 Sep 2012 08:52:14 +0000 (01:52 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 13 Sep 2012 08:52:14 +0000 (01:52 -0700)
ObjectiveC/Library.mm

index 1749d88d60a41270a50c51eb9685014a314bc30a..a113779c0beafbbc092d0ad705da238f62c7dbcc 100644 (file)
@@ -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<bool>([self boolValue]));
 } CYObjectiveCatch }
 
 @end