(condition, thenBody, elseBody)
| 1165 | } |
| 1166 | // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) |
| 1167 | if(condition, thenBody, elseBody) { |
| 1168 | this._blockNode(new If(condition)); |
| 1169 | if (thenBody && elseBody) { |
| 1170 | this.code(thenBody).else().code(elseBody).endIf(); |
| 1171 | } |
| 1172 | else if (thenBody) { |
| 1173 | this.code(thenBody).endIf(); |
| 1174 | } |
| 1175 | else if (elseBody) { |
| 1176 | throw new Error('CodeGen: "else" body without "then" body'); |
| 1177 | } |
| 1178 | return this; |
| 1179 | } |
| 1180 | // `else if` clause - invalid without `if` or after `else` clauses |
| 1181 | elseIf(condition) { |
| 1182 | return this._elseNode(new If(condition)); |
no test coverage detected