X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/489b8a0a6656251c7610bdccd1557938faa3a424..533acb3eaa6982c25ad1cd1e1b5d7a43037469bb:/ObjectiveC/Library.mm diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index e94e797..0c7712e 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -1045,9 +1045,6 @@ NSObject *CYCopyNSObject(apr_pool_t *pool, JSContextRef context, JSValueRef valu } - (bool) cy$hasProperty:(NSString *)name { - if ([name isEqualToString:@"length"]) - return true; - size_t index(CYGetIndex(name)); if (index == _not(size_t) || index >= [self length]) return [super cy$hasProperty:name]; @@ -1056,15 +1053,6 @@ NSObject *CYCopyNSObject(apr_pool_t *pool, JSContextRef context, JSValueRef valu } - (NSObject *) cy$getProperty:(NSString *)name { - if ([name isEqualToString:@"length"]) { - NSUInteger count([self length]); -#ifdef __APPLE__ - return [NSNumber numberWithUnsignedInteger:count]; -#else - return [NSNumber numberWithUnsignedInt:count]; -#endif - } - size_t index(CYGetIndex(name)); if (index == _not(size_t) || index >= [self length]) return [super cy$getProperty:name]; @@ -1082,11 +1070,6 @@ NSObject *CYCopyNSObject(apr_pool_t *pool, JSContextRef context, JSValueRef valu } } -// XXX: this might be overly restrictive for NSString; I think I need a half-way between /injecting/ implicit properties and /accepting/ implicit properties -+ (bool) cy$hasImplicitProperties { - return false; -} - - (JSValueRef) cy$valueOfInContext:(JSContextRef)context { CYObjectiveTry_(context) { return CYCastJSValue(context, CYJSString(context, self)); } CYObjectiveCatch } @@ -1100,7 +1083,7 @@ NSObject *CYCopyNSObject(apr_pool_t *pool, JSContextRef context, JSValueRef valu return kJSTypeUndefined; } -- (NSString *) cy$toCYON { +- (NSString *) cy$toCYON:(bool)objective { NSString *value(@"undefined"); return value; // XXX: maybe use the below code, adding @undefined? //return objective ? value : [NSString stringWithFormat:@"@%@", value];