diff --git a/compiler/forget/src/__tests__/fixtures/compiler/error.leave-ssa-handle-return-in-for.expect.md b/compiler/forget/src/__tests__/fixtures/compiler/error.leave-ssa-handle-return-in-for.expect.md new file mode 100644 index 0000000000..5faf9a3cc9 --- /dev/null +++ b/compiler/forget/src/__tests__/fixtures/compiler/error.leave-ssa-handle-return-in-for.expect.md @@ -0,0 +1,20 @@ + +## Input + +```javascript +function foo(props) { + for (let i = 0; i < 10; i += 1) { + return; + } +} + +``` + + +## Error + +``` +Cannot read properties of undefined (reading 'phis') +``` + + \ No newline at end of file diff --git a/compiler/forget/src/__tests__/fixtures/compiler/error.leave-ssa-handle-return-in-for.js b/compiler/forget/src/__tests__/fixtures/compiler/error.leave-ssa-handle-return-in-for.js new file mode 100644 index 0000000000..9f652923ee --- /dev/null +++ b/compiler/forget/src/__tests__/fixtures/compiler/error.leave-ssa-handle-return-in-for.js @@ -0,0 +1,5 @@ +function foo(props) { + for (let i = 0; i < 10; i += 1) { + return; + } +}