visitWriteVarExpr method

  1. @override
void visitWriteVarExpr(
  1. WriteVarExpr expr,
  2. EmitterVisitorContext context, {
  3. bool checkForNull = false,
})
override

Implementation

@override
void visitWriteVarExpr(o.WriteVarExpr expr, EmitterVisitorContext context,
    {bool checkForNull = false}) {
  var lineWasEmpty = context.lineIsEmpty();
  if (!lineWasEmpty) {
    context.print('(');
  }
  if (checkForNull) {
    context.print('${expr.name} ??= ');
  } else {
    context.print('${expr.name} = ');
  }
  expr.value.visitExpression(this, context);
  if (!lineWasEmpty) {
    context.print(')');
  }
}