Repair DSL Namespace values being constant broken in #9627

master before #9627 (a0286e9c6):

<1> => namespace n { x = 42; x = 42 }
                             ^^^^^^
Constant must not be modified.
<2> =>

HEAD of #9627 (24b57f0d3):

<1> => namespace n { x = 42; x = 42 }
null
<2> =>
This commit is contained in:
Alexander A. Klimov 2023-02-10 14:53:51 +01:00
parent 14d7ee2777
commit 02df94a46a
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ void Namespace::Set(const String& field, const Value& value, bool isConst, const
auto nsVal = m_Data.find(field);
if (nsVal == m_Data.end()) {
m_Data[field] = NamespaceValue{value, isConst};
m_Data[field] = NamespaceValue{value, isConst || m_ConstValues};
} else {
if (nsVal->second.Const) {
BOOST_THROW_EXCEPTION(ScriptError("Constant must not be modified.", debugInfo));