} CYCatch(NULL) }
static JSValueRef Instance_getProperty_$cyt(JSContextRef context, JSObjectRef object, JSStringRef property, JSValueRef *exception) { CYTry {
- return CYMakeType(context, sig::Object());
+ Instance *internal(reinterpret_cast<Instance *>(JSObjectGetPrivate(object)));
+ id self(internal->GetValue());
+ if (CYIsClass(self))
+ return CYMakeType(context, sig::Meta());
+ return CYMakeType(context, sig::Object(class_getName(object_getClass(self))));
} CYCatch(NULL) }
static JSValueRef FunctionInstance_getProperty_$cyt(JSContextRef context, JSObjectRef object, JSStringRef property, JSValueRef *exception) { CYTry {
return CYMakeType(context, type);
} CYCatch(NULL) }
-static JSValueRef Class_getProperty_$cyt(JSContextRef context, JSObjectRef object, JSStringRef property, JSValueRef *exception) { CYTry {
- return CYMakeType(context, sig::Meta());
-} CYCatch(NULL) }
-
static JSValueRef Instance_getProperty_constructor(JSContextRef context, JSObjectRef object, JSStringRef property, JSValueRef *exception) { CYTry {
Instance *internal(reinterpret_cast<Instance *>(JSObjectGetPrivate(object)));
return CYMakeInstance(context, object_getClass(internal->GetValue()), Instance::Permanent);
{NULL, NULL, 0}
};
-static JSStaticValue Class_staticValues[2] = {
- {"$cyt", &Class_getProperty_$cyt, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete},
- {NULL, NULL, NULL, 0}
-};
-
static JSStaticFunction Internal_staticFunctions[2] = {
{"$cya", &Internal_callAsFunction_$cya, kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete},
{NULL, NULL, 0}
definition = kJSClassDefinitionEmpty;
definition.className = "Class";
definition.staticFunctions = Class_staticFunctions;
- definition.staticValues = Class_staticValues;
Class_ = JSClassCreate(&definition);
definition = kJSClassDefinitionEmpty;
Copy(pool, lhs.elements[index], rhs.elements[index]);
}
-Void *Void::Copy(CYPool &pool, const char *name) const {
+Void *Void::Copy(CYPool &pool, const char *rename) const {
return new(pool) Void();
}
-Unknown *Unknown::Copy(CYPool &pool, const char *name) const {
+Unknown *Unknown::Copy(CYPool &pool, const char *rename) const {
return new(pool) Unknown();
}
-String *String::Copy(CYPool &pool, const char *name) const {
+String *String::Copy(CYPool &pool, const char *rename) const {
return new(pool) String();
}
-Meta *Meta::Copy(CYPool &pool, const char *name) const {
+Meta *Meta::Copy(CYPool &pool, const char *rename) const {
return new(pool) Meta();
}
-Selector *Selector::Copy(CYPool &pool, const char *name) const {
+Selector *Selector::Copy(CYPool &pool, const char *rename) const {
return new(pool) Selector();
}
-Bits *Bits::Copy(CYPool &pool, const char *name) const {
+Bits *Bits::Copy(CYPool &pool, const char *rename) const {
return new(pool) Bits(size);
}
-Pointer *Pointer::Copy(CYPool &pool, const char *name) const {
+Pointer *Pointer::Copy(CYPool &pool, const char *rename) const {
return new(pool) Pointer(*type.Copy(pool));
}
-Array *Array::Copy(CYPool &pool, const char *name) const {
+Array *Array::Copy(CYPool &pool, const char *rename) const {
return new(pool) Array(*type.Copy(pool), size);
}
-Object *Object::Copy(CYPool &pool, const char *name) const {
- Object *copy(new(pool) Object(pool.strdup(name)));
- copy->name = name;
- return copy;
+Object *Object::Copy(CYPool &pool, const char *rename) const {
+ return new(pool) Object(pool.strdup(name));
}
-Aggregate *Aggregate::Copy(CYPool &pool, const char *name) const {
- Aggregate *copy(new(pool) Aggregate(overlap, name));
+Aggregate *Aggregate::Copy(CYPool &pool, const char *rename) const {
+ Aggregate *copy(new(pool) Aggregate(overlap, rename ?: pool.strdup(name)));
sig::Copy(pool, copy->signature, signature);
- copy->name = name;
return copy;
}
-Function *Function::Copy(CYPool &pool, const char *name) const {
+Function *Function::Copy(CYPool &pool, const char *rename) const {
Function *copy(new(pool) Function(variadic));
sig::Copy(pool, copy->signature, signature);
return copy;
}
-Block *Block::Copy(CYPool &pool, const char *name) const {
+Block *Block::Copy(CYPool &pool, const char *rename) const {
Block *copy(new(pool) Block());
sig::Copy(pool, copy->signature, signature);
return copy;
return NULL;
}
-const char *Object::GetName() const {
- return name;
-}
-
const char *Aggregate::GetName() const {
return name;
}
{
}
- virtual Type *Copy(CYPool &pool, const char *name = NULL) const = 0;
+ virtual Type *Copy(CYPool &pool, const char *rename = NULL) const = 0;
virtual const char *GetName() const;
virtual const char *Encode(CYPool &pool) const = 0;
struct Void :
Type
{
- Void *Copy(CYPool &pool, const char *name = NULL) const override;
+ Void *Copy(CYPool &pool, const char *rename = NULL) const override;
const char *Encode(CYPool &pool) const override;
CYTypedIdentifier *Decode(CYPool &pool) const override;
struct Unknown :
Type
{
- Unknown *Copy(CYPool &pool, const char *name = NULL) const override;
+ Unknown *Copy(CYPool &pool, const char *rename = NULL) const override;
const char *Encode(CYPool &pool) const override;
CYTypedIdentifier *Decode(CYPool &pool) const override;
struct String :
Type
{
- String *Copy(CYPool &pool, const char *name = NULL) const override;
+ String *Copy(CYPool &pool, const char *rename = NULL) const override;
const char *Encode(CYPool &pool) const override;
CYTypedIdentifier *Decode(CYPool &pool) const override;
struct Meta :
Type
{
- Meta *Copy(CYPool &pool, const char *name = NULL) const override;
+ Meta *Copy(CYPool &pool, const char *rename = NULL) const override;
const char *Encode(CYPool &pool) const override;
CYTypedIdentifier *Decode(CYPool &pool) const override;
struct Selector :
Type
{
- Selector *Copy(CYPool &pool, const char *name = NULL) const override;
+ Selector *Copy(CYPool &pool, const char *rename = NULL) const override;
const char *Encode(CYPool &pool) const override;
CYTypedIdentifier *Decode(CYPool &pool) const override;
{
}
- Bits *Copy(CYPool &pool, const char *name = NULL) const override;
+ Bits *Copy(CYPool &pool, const char *rename = NULL) const override;
const char *Encode(CYPool &pool) const override;
CYTypedIdentifier *Decode(CYPool &pool) const override;
{
}
- Pointer *Copy(CYPool &pool, const char *name = NULL) const override;
+ Pointer *Copy(CYPool &pool, const char *rename = NULL) const override;
const char *Encode(CYPool &pool) const override;
CYTypedIdentifier *Decode(CYPool &pool) const override;
{
}
- Array *Copy(CYPool &pool, const char *name = NULL) const override;
+ Array *Copy(CYPool &pool, const char *rename = NULL) const override;
const char *Encode(CYPool &pool) const override;
CYTypedIdentifier *Decode(CYPool &pool) const override;
{
}
- Object *Copy(CYPool &pool, const char *name = NULL) const override;
- const char *GetName() const override;
+ Object *Copy(CYPool &pool, const char *rename = NULL) const override;
const char *Encode(CYPool &pool) const override;
CYTypedIdentifier *Decode(CYPool &pool) const override;
{
}
- Aggregate *Copy(CYPool &pool, const char *name = NULL) const override;
+ Aggregate *Copy(CYPool &pool, const char *rename = NULL) const override;
const char *GetName() const override;
const char *Encode(CYPool &pool) const override;
{
}
- Function *Copy(CYPool &pool, const char *name = NULL) const override;
+ Function *Copy(CYPool &pool, const char *rename = NULL) const override;
const char *Encode(CYPool &pool) const override;
CYTypedIdentifier *Modify(CYPool &pool, CYTypedIdentifier *result, CYTypedParameter *parameters) const override;
struct Block :
Callable
{
- Block *Copy(CYPool &pool, const char *name = NULL) const override;
+ Block *Copy(CYPool &pool, const char *rename = NULL) const override;
const char *Encode(CYPool &pool) const override;
CYTypedIdentifier *Decode(CYPool &pool) const override;