@end
@interface NSObject (Cycript)
+- (bool) cy$isUndefined;
- (NSString *) cy$toJSON;
- (JSValueRef) cy$JSValueInContext:(JSContextRef)context;
@end
@implementation NSObject (Cycript)
+- (bool) cy$isUndefined {
+ return false;
+}
+
- (NSString *) cy$toJSON {
return [self description];
}
@implementation WebUndefined (Cycript)
+- (bool) cy$isUndefined {
+ return true;
+}
+
- (NSString *) cy$toJSON {
return @"undefined";
}
[json appendString:@","];
else
comma = true;
- [json appendString:[object cy$toJSON]];
+ if (![object cy$isUndefined])
+ [json appendString:[object cy$toJSON]];
+ else {
+ [json appendString:@","];
+ comma = false;
+ }
}
[json appendString:@"]"];