dillon1000/react
Commit
Browse files fix for while (...) { break } edge case
Small adjustment to the previous PR for a special case:
```javascript
while (cond) {
break;
}
```
The loop body is an indirection to the fallthrough, so shrink() collapses that
and makes the while.loop === while.fallthrough. We now detect that this is the
case in codegen and correctly emit a `break` rather than trying to write the
fallthrough block inside the loop.Changed paths4 files
First-parent comparisoncompiler/forget/src/HIR/Codegen.ts ModifiedM compiler/forget/src/HIR/HIRBuilder.ts ModifiedA compiler/forget/src/__tests__/fixtures/hir/while-break.expect.md AddedA compiler/forget/src/__tests__/fixtures/hir/while-break.js AddedPatch
Files changed
Rendering syntax-highlighted changes…