@dhis2/expression-parser 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4186,6 +4186,15 @@
4186
4186
  var rVal = eval_0(right);
4187
4187
  return op(lVal, rVal);
4188
4188
  }
4189
+ function evalBinaryLogicOperatorShortCircuit($this, op, operator, eval_0, shortCircuitOn) {
4190
+ var left = operator.mz(0);
4191
+ var right = operator.mz(1);
4192
+ var lVal = eval_0(left);
4193
+ if (!(lVal == null) ? lVal === shortCircuitOn : false)
4194
+ return shortCircuitOn;
4195
+ var rVal = eval_0(right);
4196
+ return op(lVal, rVal);
4197
+ }
4189
4198
  function evalBinaryOperator($this, op, operator, eval_0) {
4190
4199
  var left = operator.mz(0);
4191
4200
  var right = operator.mz(1);
@@ -4638,12 +4647,12 @@
4638
4647
  case 12:
4639
4648
  var tmp_4 = Companion_instance_10;
4640
4649
  var tmp_5 = BinaryOperator$Companion$and$ref(Companion_getInstance_4());
4641
- tmp = evalBinaryOperator(tmp_4, tmp_5, operator, Calculator$evalToBoolean$ref(this));
4650
+ tmp = evalBinaryLogicOperatorShortCircuit(tmp_4, tmp_5, operator, Calculator$evalToBoolean$ref(this), false);
4642
4651
  break;
4643
4652
  case 13:
4644
4653
  var tmp_6 = Companion_instance_10;
4645
4654
  var tmp_7 = BinaryOperator$Companion$or$ref(Companion_getInstance_4());
4646
- tmp = evalBinaryOperator(tmp_6, tmp_7, operator, Calculator$evalToBoolean$ref_0(this));
4655
+ tmp = evalBinaryLogicOperatorShortCircuit(tmp_6, tmp_7, operator, Calculator$evalToBoolean$ref_0(this), true);
4647
4656
  break;
4648
4657
  case 6:
4649
4658
  var tmp_8 = Companion_instance_10;