- Type_privateData(CYPool &pool, const char *type) :
- CYData(pool),
- ffi_(NULL)
- {
- sig::Signature signature;
- sig::Parse(*pool_, &signature, type, &Structor_);
- type_ = signature.elements[0].type;
+ template <typename... Args_>
+ static JSObjectRef Make(JSContextRef context, Args_ &&... args) {
+ Internal_ *internal(new Internal_(cy::Forward<Args_>(args)...));
+ JSObjectRef object(JSObjectMake(context, Internal_::GetClass(cy::Forward<Args_>(args)...), internal));
+ if (JSValueRef prototype = internal->GetPrototype(context))
+ CYSetPrototype(context, object, prototype);
+ return object;