Fix accessor for field 0 ("prototype")

fixes #9778
This commit is contained in:
Gunnar Beutner 2015-07-30 08:23:43 +02:00
parent f74148f157
commit a82c65692c
1 changed files with 10 additions and 4 deletions

View File

@ -76,13 +76,19 @@ void Object::InflateMutex(void)
m_Mutex.Inflate(); m_Mutex.Inflate();
} }
void Object::SetField(int, const Value&) void Object::SetField(int id, const Value&)
{ {
if (id == 0)
BOOST_THROW_EXCEPTION(std::runtime_error("Prototype field cannot be set."));
else
BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID.")); BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID."));
} }
Value Object::GetField(int) const Value Object::GetField(int id) const
{ {
if (id == 0)
return Empty;
else
BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID.")); BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID."));
} }