diff --git a/lib/base/type.cpp b/lib/base/type.cpp index 93ae1b9bd..a26d8cf9b 100644 --- a/lib/base/type.cpp +++ b/lib/base/type.cpp @@ -88,6 +88,16 @@ void Type::SetPrototype(const Object::Ptr& object) m_Prototype = object; } +void Type::SetField(int id, const Value& value) +{ + if (id == 0) { + SetPrototype(value); + return; + } + + Object::SetField(id, value); +} + Value Type::GetField(int id) const { if (id == 0) diff --git a/lib/base/type.hpp b/lib/base/type.hpp index 30fd671a5..f1b006daf 100644 --- a/lib/base/type.hpp +++ b/lib/base/type.hpp @@ -81,6 +81,7 @@ public: static void Register(const Type::Ptr& type); static Type::Ptr GetByName(const String& name); + virtual void SetField(int id, const Value& value); virtual Value GetField(int id) const; protected: