diff --git a/core/misc/states.es6.js b/core/misc/states.es6.js index 49baa7c7f5..ff958b7568 100644 --- a/core/misc/states.es6.js +++ b/core/misc/states.es6.js @@ -253,16 +253,19 @@ // shouldn't normally occur, but in case the condition definition is // bogus, we don't want to end up with an infinite loop. else if ($.isPlainObject(constraints)) { - // This constraint is an object (AND). The ternary function will return - // true if the result of checking the constraint is undefined. - result = Object.keys(constraints).every(constraint => ternary( - true, - this.checkConstraints( + // This constraint is an object (AND). + result = Object.keys(constraints).every((constraint) => { + const check = this.checkConstraints( constraints[constraint], selector, constraint, - ), - )); + ); + /** + * The checkConstraints() function's return value can be undefined. If + * this so, consider it to have returned true. + */ + return typeof check === 'undefined' ? true : check; + }); } return result; }, diff --git a/core/misc/states.js b/core/misc/states.js index 0cafb60a71..07a5fd67ed 100644 --- a/core/misc/states.js +++ b/core/misc/states.js @@ -129,7 +129,9 @@ } } else if ($.isPlainObject(constraints)) { result = Object.keys(constraints).every(function (constraint) { - return ternary(true, _this3.checkConstraints(constraints[constraint], selector, constraint)); + var check = _this3.checkConstraints(constraints[constraint], selector, constraint); + + return typeof check === 'undefined' ? true : check; }); } return result;