//
// Object_Custom
//

#include "ascript/Object_Custom.h"

namespace AScript {

bool Class_Custom::IsCustom() const { return true; }

Class_Custom::Class_Custom(const Class_Custom &cls) : Class(cls)
{
}

Class_Custom::Class_Custom(Environment *pEnv, Class *pClassSuper) : Class(pClassSuper)
{
	AddLackingFrame(pEnv);
}

Class_Custom::~Class_Custom()
{
}

Object *Class_Custom::CreateDescendant(Environment &env, Signal sig, Class *pClass)
{
	Object *pObj = _pClassSuper->CreateDescendant(env, sig, pClass);
	if (pObj == NULL) {
		sig.SetError(ERR_ValueError,
					"not an inheritable class %s", _pClassSuper->GetName());
		return NULL;
	}
	return pObj;
}

}
