dillon1000/react

Commit

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.
Browse files
Changed paths4 files
First-parent comparison
M compiler/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 Added
Patch

Files changed

Rendering syntax-highlighted changes…