virtual Type_privateData *GetType() const;
};
+namespace cy {
struct Super :
Instance
{
JSObjectRef value(JSObjectMake(context, Super_, new Super(object, _class)));
return value;
}
-};
+}; }
struct Messages :
CYValue
return object;
}
-void CYThrow(JSContextRef context, id error, JSValueRef *exception) {
+void CYThrow(JSContextRef context, NSException *error, JSValueRef *exception) {
if (exception == NULL)
throw error;
*exception = CYCastJSValue(context, error);
JSValueRef exception(NULL);
const char *cyon(CYPoolCCYON(pool, context_, object_));
CYThrow(context_, exception);
- return cyon == NULL ? [super cy$toCYON] : [NSString stringWithUTF8String:cyon];
+ if (cyon == NULL)
+ return [super cy$toCYON];
+ else
+ return [NSString stringWithUTF8String:cyon];
}
- (NSUInteger) count {
CYPool pool;
Class _class(object_getClass(self));
+#ifdef __APPLE__
{
unsigned int size;
objc_property_t *data(class_copyPropertyList(_class, &size));
JSPropertyNameAccumulatorAddName(names, CYJSString(property_getName(data[i])));
free(data);
}
+#endif
}
static JSObjectRef Instance_callAsConstructor(JSContextRef context, JSObjectRef object, size_t count, const JSValueRef arguments[], JSValueRef *exception) {
_throw(NSInvalidArgumentException, "too few arguments to objc_msgSend");
if (JSValueIsObjectOfClass(context, arguments[0], Super_)) {
- Super *internal(reinterpret_cast<Super *>(JSObjectGetPrivate((JSObjectRef) arguments[0])));
+ cy::Super *internal(reinterpret_cast<cy::Super *>(JSObjectGetPrivate((JSObjectRef) arguments[0])));
self = internal->GetValue();
_class = internal->class_;;
uninitialized = false;
if (count != 2)
_throw(NSInvalidArgumentException, "incorrect number of arguments to Super constructor");
CYPool pool;
- NSObject *self(CYCastNSObject(pool, context, arguments[0]));
+ id self(CYCastNSObject(pool, context, arguments[0]));
Class _class(CYCastClass(pool, context, arguments[1]));
- return Super::Make(context, self, _class);
+ return cy::Super::Make(context, self, _class);
} CYCatch
}