Files
oxc-project__oxc/crates/oxc_react_compiler/fixtures/for-empty-test.js
Boshen b1201f1c8f fix(react-compiler): support for loops without test expressions (#25990)
Support for (;;) by lowering the omitted test to true and omitting the synthetic HIR initializer during codegen.

AI assistance was used to implement and verify this change.
2026-08-22 06:24:33 +00:00

18 lines
234 B
JavaScript

function Component(props) {
let index = 0;
let total = 0;
for (;;) {
index++;
if (index < props.start) {
continue;
}
total += index;
if (index >= props.end) {
break;
}
}
return total;
}