Some more variable scoping fixes.

Refs #5846
This commit is contained in:
Gunnar Beutner 2014-03-24 09:44:18 +01:00
parent 3032cf8100
commit 4ec939f332
1 changed files with 20 additions and 0 deletions

View File

@ -357,9 +357,14 @@ Value AExpression::OpSetPlus(const AExpression *expr, const Dictionary::Ptr& loc
if (!xlocals)
xlocals = make_shared<Dictionary>();
xlocals->Set("__parent", locals);
}
Value result = left + expr->EvaluateOperand2(xlocals);
xlocals->Remove("__parent");
locals->Set(expr->m_Operand1, result);
return result;
}
@ -375,9 +380,14 @@ Value AExpression::OpSetMinus(const AExpression *expr, const Dictionary::Ptr& lo
if (!xlocals)
xlocals = make_shared<Dictionary>();
xlocals->Set("__parent", locals);
}
Value result = left - expr->EvaluateOperand2(xlocals);
xlocals->Remove("__parent");
locals->Set(expr->m_Operand1, result);
return result;
}
@ -393,9 +403,14 @@ Value AExpression::OpSetMultiply(const AExpression *expr, const Dictionary::Ptr&
if (!xlocals)
xlocals = make_shared<Dictionary>();
xlocals->Set("__parent", locals);
}
Value result = left * expr->EvaluateOperand2(xlocals);
xlocals->Remove("__parent");
locals->Set(expr->m_Operand1, result);
return result;
}
@ -411,9 +426,14 @@ Value AExpression::OpSetDivide(const AExpression *expr, const Dictionary::Ptr& l
if (!xlocals)
xlocals = make_shared<Dictionary>();
xlocals->Set("__parent", locals);
}
Value result = left / expr->EvaluateOperand2(xlocals);
xlocals->Remove("__parent");
locals->Set(expr->m_Operand1, result);
return result;
}