From: Jay Freeman (saurik) Date: Mon, 4 Jun 2012 03:51:53 +0000 (-0700) Subject: The keys of NSDictionary need to be CYCastNSObject. X-Git-Tag: v0.9.455~7 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/5663aea569340c65154cd536395861a123d186ee The keys of NSDictionary need to be CYCastNSObject. --- diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index 5b679cb..4140247 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -399,7 +399,6 @@ JSObjectRef CYMakeInstance(JSContextRef context, id object, bool transient) { - (NSObject *) cy$toJSON:(NSString *)key; - (NSString *) cy$toCYON; -- (NSString *) cy$toKey; - (bool) cy$hasProperty:(NSString *)name; - (NSObject *) cy$getProperty:(NSString *)name; @@ -821,7 +820,7 @@ NSObject *CYCopyNSObject(apr_pool_t *pool, JSContextRef context, JSValueRef valu [json appendString:@","]; else comma = true; - [json appendString:[key cy$toKey]]; + [json appendString:CYCastNSCYON(key)]; [json appendString:@":"]; NSObject *object([self objectForKey:key]); [json appendString:CYCastNSCYON(object)]; @@ -998,10 +997,6 @@ NSObject *CYCopyNSObject(apr_pool_t *pool, JSContextRef context, JSValueRef valu return [[self cy$toJSON:@""] cy$toCYON]; } -- (NSString *) cy$toKey { - return [self cy$toCYON]; -} - - (bool) cy$hasProperty:(NSString *)name { return false; } @@ -1064,12 +1059,6 @@ NSObject *CYCopyNSObject(apr_pool_t *pool, JSContextRef context, JSValueRef valu return CYCastNSString(NULL, CYUTF8String(value.c_str(), value.size())); } -- (NSString *) cy$toKey { - if (CYIsKey(CYCastUTF8String(self))) - return self; - return [self cy$toCYON]; -} - - (bool) cy$hasProperty:(NSString *)name { if ([name isEqualToString:@"length"]) return true;