MCPcopy Index your code
hub / github.com/josdejong/mathjs / constructor

Method constructor

src/expression/node/ConditionalNode.js:55–64  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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 }

Callers

nothing calls this directly

Calls 1

isNodeFunction · 0.90

Tested by

no test coverage detected