Throw when left operand not provided

8c87a24e5da71543202272478747080d28a16b24

Wolfsblvt <wolfsblvt@gmail.com>

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