Remove __parent element for +=, -=, *= and /= operators.

Refs #5846
This commit is contained in:
Gunnar Beutner 2014-03-24 11:34:41 +01:00
parent c66ac66219
commit 013690e486
2 changed files with 18 additions and 4 deletions

View File

@ -368,7 +368,10 @@ Value AExpression::OpSetPlus(const AExpression *expr, const Dictionary::Ptr& loc
Value result = left + expr->EvaluateOperand2(xlocals);
xlocals->Remove("__parent");
if (exp_right->m_Operator == &AExpression::OpDict) {
Dictionary::Ptr dict = result;
dict->Remove("__parent");
}
locals->Set(expr->m_Operand1, result);
return result;
@ -391,7 +394,10 @@ Value AExpression::OpSetMinus(const AExpression *expr, const Dictionary::Ptr& lo
Value result = left - expr->EvaluateOperand2(xlocals);
xlocals->Remove("__parent");
if (exp_right->m_Operator == &AExpression::OpDict) {
Dictionary::Ptr dict = result;
dict->Remove("__parent");
}
locals->Set(expr->m_Operand1, result);
return result;
@ -414,7 +420,10 @@ Value AExpression::OpSetMultiply(const AExpression *expr, const Dictionary::Ptr&
Value result = left * expr->EvaluateOperand2(xlocals);
xlocals->Remove("__parent");
if (exp_right->m_Operator == &AExpression::OpDict) {
Dictionary::Ptr dict = result;
dict->Remove("__parent");
}
locals->Set(expr->m_Operand1, result);
return result;
@ -437,7 +446,10 @@ Value AExpression::OpSetDivide(const AExpression *expr, const Dictionary::Ptr& l
Value result = left / expr->EvaluateOperand2(xlocals);
xlocals->Remove("__parent");
if (exp_right->m_Operator == &AExpression::OpDict) {
Dictionary::Ptr dict = result;
dict->Remove("__parent");
}
locals->Set(expr->m_Operand1, result);
return result;

View File

@ -157,6 +157,8 @@ Dictionary::Ptr ConfigItem::GetProperties(void)
m_Properties->Set("__parent", m_Scope);
GetLinkedExpressionList()->Evaluate(m_Properties);
m_Properties->Remove("__parent");
VERIFY(m_Properties->Get("__type") == GetType() && m_Properties->Get("__name") == GetName());
}
return m_Properties;