KAI_BEGIN Registry &Reflected::Reg() const { if (!Self || !Self->Exists()) KAI_THROW_0(NullObject); return *Self->GetRegistry(); }
void Registry::AddClass(const ClassBase *klass) { if (klass == 0) KAI_THROW_0(NullObject); if (GetClass(klass->GetTypeNumber())) KAI_THROW_1(Base, "Duplicate Class"); classes[klass->GetTypeNumber().ToInt()] = klass; }
void Continuation::Enter(Executor *exec) { if (code.Exists() && !code->Empty()) { if (!scope.Exists()) scope = exec->New<void>(); Stack &data = *exec->GetDataStack(); if (data.Size() < args->Size()) { KAI_TRACE_ERROR_2(data.Size(), args->Size()) << "Failed to enter continuation: not enough args"; KAI_THROW_0(EmptyStack); } for (auto arg : *args) { Object a = data.Pop(); scope.Set(ConstDeref<Label>(arg), a); } } *index = 0; }