//
JsStatement bodyStmt = mapStatement(fromBody);
if (bodyStmt != null) {
toForIn.setBody(bodyStmt);
} else {
toForIn.setBody(new JsEmpty(info));
}
return toForIn;
} else {
// Regular ol' for loop.
//
JsFor toFor = new JsFor(info);
// The first item is either an expression or a JsVars.
JsNode initThingy = map(fromInit);
if (initThingy != null) {
if (initThingy instanceof JsVars) {
toFor.setInitVars((JsVars) initThingy);
} else {
assert (initThingy instanceof JsExpression);
toFor.setInitExpr((JsExpression) initThingy);
}
}
toFor.setCondition(mapOptionalExpression(fromTest));
toFor.setIncrExpr(mapOptionalExpression(fromIncr));
JsStatement bodyStmt = mapStatement(fromBody);
if (bodyStmt != null) {
toFor.setBody(bodyStmt);
} else {
toFor.setBody(new JsEmpty(info));
}
return toFor;
}
}