Throw when left operand not provided

8c87a24e5da71543202272478747080d28a16b24

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +4 -0Ignore whitespace
public/scripts/variables.js+4 -0
@@ -544,6 +544,10 @@ export function parseBooleanOperands(args) {
544 * @returns {boolean} True if the rule yields true, false otherwise544 * @returns {boolean} True if the rule yields true, false otherwise
545 */545 */
546export function evalBoolean(rule, a, b) {546export function evalBoolean(rule, a, b) {
547 if (a === undefined) {
548 throw new Error('Left operand is not provided');
549 }
550
547 // If right-hand side was not provided, whe just check if the left side is truthy551 // If right-hand side was not provided, whe just check if the left side is truthy
548 if (b === undefined) {552 if (b === undefined) {
549 switch (rule) {553 switch (rule) {