Handle parsing number into boolean expression

This commit is contained in:
nathan 2023-07-06 08:29:30 -06:00
parent bd93964de3
commit 186a7d46dd

View File

@ -351,11 +351,16 @@ export class et2_arrayMgr
parseBoolExpression(_expression : string) parseBoolExpression(_expression : string)
{ {
if (typeof _expression === "undefined" || _expression === null) if(typeof _expression === "undefined" || _expression === null)
{ {
return false; return false;
} }
if(typeof _expression === "number")
{
return !!_expression;
}
// Check whether "$" occurs in the given identifier, don't parse rows if we're not in a row // Check whether "$" occurs in the given identifier, don't parse rows if we're not in a row
// This saves booleans in repeating rows from being parsed too early - we'll parse again when repeating // This saves booleans in repeating rows from being parsed too early - we'll parse again when repeating
if(_expression.indexOf('$') >= 0 && this.perspectiveData.row == null && _expression.match(/\$\{?row\}?/)) if(_expression.indexOf('$') >= 0 && this.perspectiveData.row == null && _expression.match(/\$\{?row\}?/))