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