We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3f57d3 commit bcca3d2Copy full SHA for bcca3d2
server/src/tbaf.ts
@@ -631,6 +631,18 @@ function unrollForLoop(forStatement: ForStatement, vars: varsContext) {
631
return;
632
}
633
634
+ // Ensure the loop boundary is numeric
635
+ if (Node.isBinaryExpression(condition)) {
636
+ const conditionValue = condition.getRight().getText();
637
+ if (isNaN(Number(conditionValue))) {
638
+ console.log(`Skipping loop with non-numeric boundary: ${conditionValue}`);
639
+ return;
640
+ }
641
+ } else {
642
+ console.log("Skipping loop with unsupported condition type.");
643
644
645
+
646
// Get the incrementor (e.g., `i++`, `i += 2`)
647
const incrementor = forStatement.getIncrementor();
648
if (!incrementor) {
0 commit comments