( expr: Expression, seqName: string )
| 650 | if (!constraintsExpr) return true; |
| 651 | |
| 652 | // A constraint that reads the term that it checks, also through other |
| 653 | // terms, makes the index not valid. Without this, the check of the |
| 654 | // term starts again in the check, with no end. The checks that are in |
| 655 | // progress are also limited in depth, as the recursive computations |
| 656 | // of terms are (`MAX_RECURSION_DEPTH`). |
| 657 | const key = indexKeyOf(indices); |
| 658 | if (constraintChecks.has(key)) return false; |
| 659 | if (recursionDepth >= MAX_RECURSION_DEPTH) { |
| 660 | stopSequenceReads(); |
| 661 | return false; |
| 662 | } |
| 663 | constraintChecks.add(key); |
| 664 | recursionDepth += 1; |
| 665 | try { |
| 666 | return checkConstraints(engine, constraintsExpr, variables, indices); |
| 667 | } finally { |
| 668 | recursionDepth -= 1; |
| 669 | constraintChecks.delete(key); |
| 670 | } |
| 671 | }; |
no test coverage detected