private Stmt InitObj(TypeReference type) { var expr = this.stack.Pop(); var stmt = new StmtInitObj(this.ctx, expr, type); return(stmt); }
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); }
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); }
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); } }