-
Notifications
You must be signed in to change notification settings - Fork 50.4k
Updated prod error code test to be fiber-compat #8678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated prod error code test to be fiber-compat #8678
Conversation
This test previously returned undefined from render() in order to cause an error. Fiber permits this. I've updated the test instead to trigger a different error that both Stack and Fiber share in common.
sophiebits
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fiber should not allow this (unless it's an intentional change, in which stack also should).
|
What's the argument against treating |
|
Related: #8648 where I implement the opposite. 😄 |
|
That said I think we should have separate tests covering this situation (undefined from render). This particular test is about error codes, not about behavior. |
Agreed. I don't know the backstory about why |
|
From https://fburl.com/r6pdr0a8 (FB-internal link), @sebmarkbage said in 2014:
Mostly I think we thought it was safer to disallow undefined so that forgetting to return anything is an error. I'm okay with changing it if we want to but we can't just have random stack/fiber divergences. |
|
The existing behavior (which Fiber currently doesn't pass) is covered by this test. |
|
Why not leave this test alone and just fix both tests by adding the invariant? |
That's a compelling argument. 👍 |
|
Then let's get #8648 reviewed! |
|
Going to close this PR in favor of #8648 then. Thanks! |
This test previously returned
undefinedfromrender()to cause an error. Fiber allows this though so the test was failing. I've updated the test instead to trigger a different error that both Stack and Fiber share in common.