()
| 76 | } |
| 77 | |
| 78 | generateJsAst(): ASTNode { |
| 79 | const test = (this.getCondition().getChild(0) as JavaScriptSplootNode).generateJsAst() as ExpressionKind |
| 80 | const statements = [] |
| 81 | this.getTrueBlock().children.forEach((node: JavaScriptSplootNode) => { |
| 82 | let ast = node.generateJsAst() |
| 83 | if (node.type === SPLOOT_EXPRESSION) { |
| 84 | ast = recast.types.builders.expressionStatement(ast as ExpressionKind) |
| 85 | } |
| 86 | statements.push(ast) |
| 87 | }) |
| 88 | const consequent = recast.types.builders.blockStatement(statements) |
| 89 | return recast.types.builders.ifStatement(test, consequent) |
| 90 | } |
| 91 | |
| 92 | static deserializer(serializedNode: SerializedNode): IfStatement { |
| 93 | const node = new IfStatement(null) |
nothing calls this directly
no test coverage detected