dillon1000/react
Commit
Browse files [repro] Forget outputs invalid code when we bailout
Sprout output:
```
$ sprout --filter --verbose
FAIL: bug-invalid-code-when-bailout
Difference in forget and non-forget results.
Expected result: {
"kind": "ok",
"value": "{}",
"logs": []
}
Found: {
"kind": "exception",
"value": "Cannot access 'bar' before initialization",
"logs": [
"'The above error occurred in one of your React components:\\n' +\n '\\n' +\n
' at globalThis.WrapperTestComponent
(/Users/feifei0/fb/react-forget/packages/sprout/dist/runner-evaluator.js:30:26)\\n'
+\n '\\n' +\n 'Consider adding an error boundary to your tree to customize
error handling behavior.\\n' +\n 'Visit
https://reactjs.org/link/error-boundaries to learn more about error
boundaries.'"
]
}
```Changed paths3 files
First-parent comparisoncompiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/repro-retain-source-when-bailout.expect.md AddedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/repro-retain-source-when-bailout.js AddedM compiler/packages/sprout/src/SproutTodoFilter.ts ModifiedPatch
Files changed
Rendering syntax-highlighted changes…