mirror of https://github.com/Icinga/icinga2.git
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:
parent
14d7ee2777
commit
02df94a46a
|
@ -58,7 +58,7 @@ void Namespace::Set(const String& field, const Value& value, bool isConst, const
|
||||||
auto nsVal = m_Data.find(field);
|
auto nsVal = m_Data.find(field);
|
||||||
|
|
||||||
if (nsVal == m_Data.end()) {
|
if (nsVal == m_Data.end()) {
|
||||||
m_Data[field] = NamespaceValue{value, isConst};
|
m_Data[field] = NamespaceValue{value, isConst || m_ConstValues};
|
||||||
} else {
|
} else {
|
||||||
if (nsVal->second.Const) {
|
if (nsVal->second.Const) {
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("Constant must not be modified.", debugInfo));
|
BOOST_THROW_EXCEPTION(ScriptError("Constant must not be modified.", debugInfo));
|
||||||
|
|
Loading…
Reference in New Issue