* A lazy evaluating conditional operator: 'condition ? trueExpr : falseExpr' * * @param {Node} condition Condition, must result in a boolean * @param {Node} trueExpr Expression evaluated when condition is true * @param {Node} falseExpr Expression evaluated when condition i
(condition, trueExpr, falseExpr)
| 53 | * @extends {Node} |
| 54 | */ |
| 55 | constructor (condition, trueExpr, falseExpr) { |
| 56 | super() |
| 57 | if (!isNode(condition)) { throw new TypeError('Parameter condition must be a Node') } |
| 58 | if (!isNode(trueExpr)) { throw new TypeError('Parameter trueExpr must be a Node') } |
| 59 | if (!isNode(falseExpr)) { throw new TypeError('Parameter falseExpr must be a Node') } |
| 60 | |
| 61 | this.condition = condition |
| 62 | this.trueExpr = trueExpr |
| 63 | this.falseExpr = falseExpr |
| 64 | } |
| 65 | |
| 66 | static name = name |
| 67 | get type () { return name } |