- _finline JSValueRef GetPrototype(JSContextRef context) const {
- return NULL;
- }
-};
-
-template <typename Internal_, typename Base_ = CYRoot>
-struct CYPrivateOld :
- Base_
-{
- static JSClassRef Class_;
-
- template <typename... Args_>
- _finline static JSClassRef GetClass(Args_ &&... args) {
- return Class_;
- }
-
- 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;