bindingToUpdateStatements function
List<Statement>
bindingToUpdateStatements(
- Binding binding,
- Expression? appViewInstance,
- NodeReference? renderNode,
- bool isHtmlElement,
- Expression currValExpr,
Returns statements that update a binding
.
Implementation
List<o.Statement> bindingToUpdateStatements(
ir.Binding binding,
o.Expression? appViewInstance,
NodeReference? renderNode,
bool isHtmlElement,
o.Expression currValExpr,
) {
// Wraps current value with sanitization call if necessary.
var renderValue =
_sanitizedValue(binding.target.securityContext, currValExpr);
var visitor = _UpdateStatementsVisitor(
appViewInstance, renderNode, binding.source, isHtmlElement, currValExpr);
var updateStatement = binding.target.accept(visitor, renderValue);
if (binding.source is BoundExpression) {
updateStatement.sourceReference =
(binding.source as BoundExpression).sourceReference;
}
var devToolsStatement =
devToolsBindingStatement(binding, appViewInstance, currValExpr);
return [
if (devToolsStatement != null) devToolsStatement,
updateStatement,
];
}