-- (NSObject *) cy$toJSON:(NSString *)key { CYObjectiveTry {
- JSValueRef toJSON(CYGetProperty(context_, object_, toJSON_s));
- if (!CYIsCallable(context_, toJSON))
- return [super cy$toJSON:key];
- else {
- JSValueRef arguments[1] = {CYCastJSValue(context_, key)};
- JSValueRef value(CYCallAsFunction(context_, (JSObjectRef) toJSON, object_, 1, arguments));
- // XXX: do I really want an NSNull here?!
- return CYCastNSObject(NULL, context_, value) ?: [NSNull null];
- }
-} CYObjectiveCatch }
-
-- (NSString *) cy$toCYON { CYObjectiveTry {