-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Loosen restriction on requiring return expressions when a throw is used instead #1042
Comments
I have a branch with an implementation of simple control flow analysis that captures cases like this atop of new compiler. It is slightly out of date but I think it'll take less than a day to sync it |
We should treat |
Any update on this? I often use |
The new control analysis work should make this issue obsolete. Have you tried |
No, I'm stuck on the npmjs version. (1.8.10?) Good to know then! :-) |
@RyanCavanaugh I think this can be closed? |
Agree, thanks! |
Per #947, we currently require a
return
expression in a non-void returning function unless the first and only expression is athrow
statement. This is basically an exemption to allow forthrow new Exception('Not Yet Implemented')
. It seems reasonable to allow throwing further along in a block if we're willing to try to track control flow, at which point we could likely also check for appropriatereturn
expressions from all branches.The text was updated successfully, but these errors were encountered: