# Code coverage report for lib/parser/ast/ternaryCondition.js

## Statements: 88.89% (8 / 9) Branches: 100% (0 / 0) Functions: 50% (1 / 2) Lines: 88.89% (8 / 9) Ignored: none

All files » lib/parser/ast/ » ternaryCondition.js

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    201

    1
    17
    17
    17
    17

    1

    1
     var BaseExpression = require("./base");

    function TernaryConditionExpression(condition, tExpression, fExpression) {
      this.condition = condition;
      this.tExpression = tExpression;
      this.fExpression = fExpression;
      BaseExpression.apply(this, arguments);
    }

    BaseExpression.extend(TernaryConditionExpression, {
      type: "ternaryCondition",
      toJavaScript: function() {
        return this.condition.toJavaScript()  +
        "?" + this.tExpression.toJavaScript() +
        ":" + this.fExpression.toJavaScript();
      }
    });

    module.exports = TernaryConditionExpression;