mirror of https://github.com/Icinga/icinga2.git
parent
1ff8aaa2bc
commit
28734daa06
|
@ -165,7 +165,8 @@ DynamicObject::Ptr ConfigItem::Commit(bool discard)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ScriptFrame frame(dobj);
|
ScriptFrame frame(dobj);
|
||||||
frame.Locals = m_Scope;
|
if (m_Scope)
|
||||||
|
m_Scope->CopyTo(frame.Locals);
|
||||||
m_Expression->Evaluate(frame, &debugHints);
|
m_Expression->Evaluate(frame, &debugHints);
|
||||||
} catch (const ScriptError& ex) {
|
} catch (const ScriptError& ex) {
|
||||||
ConfigCompilerContext::GetInstance()->AddMessage(true, ex.what(), ex.GetDebugInfo());
|
ConfigCompilerContext::GetInstance()->AddMessage(true, ex.what(), ex.GetDebugInfo());
|
||||||
|
|
|
@ -122,7 +122,7 @@ bool VariableExpression::GetReference(ScriptFrame& frame, bool init_dict, Value
|
||||||
if (dhint)
|
if (dhint)
|
||||||
*dhint = NULL;
|
*dhint = NULL;
|
||||||
} else
|
} else
|
||||||
*parent = frame.Locals;
|
*parent = frame.Self;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -418,8 +418,8 @@ bool IndexerExpression::GetReference(ScriptFrame& frame, bool init_dict, Value *
|
||||||
String vindex;
|
String vindex;
|
||||||
|
|
||||||
if (m_Operand1->GetReference(frame, init_dict, &vparent, &vindex, dhint)) {
|
if (m_Operand1->GetReference(frame, init_dict, &vparent, &vindex, dhint)) {
|
||||||
if (init_dict && VMOps::GetField(vparent, vindex).IsEmpty())
|
if (init_dict && VMOps::GetField(vparent, vindex, m_Operand1->GetDebugInfo()).IsEmpty())
|
||||||
VMOps::SetField(vparent, vindex, new Dictionary());
|
VMOps::SetField(vparent, vindex, new Dictionary(), m_Operand1->GetDebugInfo());
|
||||||
|
|
||||||
*parent = VMOps::GetField(vparent, vindex, m_DebugInfo);
|
*parent = VMOps::GetField(vparent, vindex, m_DebugInfo);
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Reference in New Issue