Ejemplo n.º 1
0
        private Stmt InitObj(TypeReference type)
        {
            var expr = this.stack.Pop();
            var stmt = new StmtInitObj(this.ctx, expr, type);

            return(stmt);
        }
Ejemplo n.º 2
0
 protected override ICode VisitInitObj(StmtInitObj s)
 {
     this.NewLine();
     this.code.AppendFormat("init-object<{0}>(", s.Type.Name);
     this.Visit(s.Destination);
     this.code.Append(")");
     return(s);
 }
Ejemplo n.º 3
0
        protected override ICode VisitInitObj(StmtInitObj s)
        {
            this.NewLine();
            this.Visit(s.Destination);
            this.js.Append(" = ");
            var defaultValue = DefaultValuer.Get(s.Type, this.resolver.FieldNames);

            this.js.Append(defaultValue);
            this.js.Append(";");
            return(s);
        }
Ejemplo n.º 4
0
        protected virtual ICode VisitInitObj(StmtInitObj s)
        {
            this.ThrowOnNoOverride();
            var destination = (Expr)this.Visit(s.Destination);

            if (destination != s.Destination)
            {
                return(new StmtInitObj(s.Ctx, destination, s.Type));
            }
            else
            {
                return(s);
            }
        }