executeConditional method

dynamic executeConditional(
  1. Expression testExp,
  2. Node consequent,
  3. Node? alternate
)

Implementation

dynamic executeConditional(
    Expression testExp, Node consequent, Node? alternate) {
  dynamic condition = getValueFromExpression(testExp);
  bool test = toBoolean(condition);
  dynamic rtn;
  if (test) {
    rtn = consequent.visitBy(this);
  } else {
    if (alternate != null) {
      rtn = alternate.visitBy(this);
    }
  }
  return rtn;
}