protected override ICode VisitAssignment(ExprAssignment e) {
     var expr = (Expr)this.Visit(e.Expr);
     if (expr != e.Expr) {
         return new ExprAssignment(e.Ctx, e.Target, expr);
     } else {
         return e;
     }
 }
 protected override ICode VisitAssignment(ExprAssignment e) {
     var expr = (Expr)this.Visit(e.Expr);
     var type = expr.Type;
     if (type.IsNonPrimitiveValueType()) {
         if (expr.ExprType != Expr.NodeType.VarThis && !type.IsRuntimeHandle() && !type.IsEnum()) {
             // This will not copy pointers to value-types, which is correct.
             // It will only copy actual value-types, except 'this' and runtime handles and enums
             expr = InternalFunctions.ValueTypeDeepCopyIfRequired(expr.Type, () => expr) ?? expr;
         }
     }
     if (expr != e.Expr) {
         return new StmtAssignment(e.Ctx, e.Target, expr);
     } else {
         return e;
     }
 }
 protected override ICode VisitAssignment(ExprAssignment e) {
     var ctx = e.Ctx;
     var expr = (Expr)this.Visit(e.Expr);
     var target = (ExprVar)this.Visit(e.Target);
     if (target.Type.IsBoolean() && expr.Type.IsInteger()) {
         expr = new ExprJsExplicit(ctx, "!!expr", ctx.Boolean, expr.Named("expr"));
     } else if (target.Type.IsUnsignedInteger() && expr.Type.IsSignedInteger()) {
         expr = new ExprConv(ctx, expr, expr.Type.UnsignedEquivilent(ctx.TypeSystem), false);
     }
     if (expr != e.Expr || target != e.Target) {
         return new ExprAssignment(ctx, target, expr);
     } else {
         return e;
     }
 }
Пример #4
0
 protected override ICode VisitAssignment(ExprAssignment e) {
     this.js.Append("(");
     this.Visit(e.Target);
     this.js.Append(" = ");
     this.Visit(e.Expr);
     this.js.Append(")");
     return e;
 }
Пример #5
0
 protected override ICode VisitAssignment(ExprAssignment e) {
     this.NewLine();
     this.Visit(e.Target);
     this.code.Append(" = ");
     this.Visit(e.Expr);
     return e;
 }
 protected override ICode VisitAssignment(ExprAssignment e) {
     this.stack.Peek().Add(e.Target);
     this.Visit(e.Expr);
     return e;
 }