public static JSIfStatement New(params KeyValuePair <JSExpression, JSStatement>[] conditions) { if ((conditions == null) || (conditions.Length == 0)) { throw new ArgumentNullException("conditions"); } JSIfStatement result = new JSIfStatement( conditions[0].Key, conditions[0].Value ); JSIfStatement next = null, current = result; for (int i = 1; i < conditions.Length; i++) { var cond = conditions[i].Key; if (cond != null) { next = new JSIfStatement(cond, conditions[i].Value); current._FalseClause = next; current = next; } else { current._FalseClause = conditions[i].Value; } } return(result); }
public void VisitNode(JSIfStatement ifs) { VisitChildren(ifs); }
public static JSIfStatement New(params KeyValuePair<JSExpression, JSStatement>[] conditions) { if ((conditions == null) || (conditions.Length == 0)) throw new ArgumentNullException("conditions"); JSIfStatement result = new JSIfStatement( conditions[0].Key, conditions[0].Value ); JSIfStatement next = null, current = result; for (int i = 1; i < conditions.Length; i++) { var cond = conditions[i].Key; if (cond != null) { next = new JSIfStatement(cond, conditions[i].Value); current._FalseClause = next; current = next; } else current._FalseClause = conditions[i].Value; } return result; }
public JSStatement TranslateNode(ILCondition condition) { JSStatement result = null; if (TranslateCallSiteConstruction(condition, out result)) return result; JSStatement falseBlock = null; if ((condition.FalseBlock != null) && (condition.FalseBlock.Body.Count > 0)) falseBlock = TranslateNode(condition.FalseBlock); result = new JSIfStatement( TranslateNode(condition.Condition), TranslateNode(condition.TrueBlock), falseBlock ); return result; }
public void VisitNode(JSIfStatement node) { VisitChildren(node); }