-
Notifications
You must be signed in to change notification settings - Fork 2k
Switch statment with empty control expression defaults to false #2416
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
Comments
This is on purpose and useful. You are switching on |
@gkz Hmm, I see.
However, don't see ths documented on the official site. |
It's intentional and undocumented. There's already an issue open that mentions that this needs to be documented. See #1808. @gabehollombe volunteered to improve the documentation. |
I was thinking of a good case of empty switch as part of documenting this feature and I think that it's does better in conditional assignment of value, which improves redability due to use of indent, unlike in
|
Yep, that's a great example. Do you want me to just go with that, and On Wed, Jul 4, 2012 at 10:56 AM, OnesimusUnbound <
|
@gabehollombe sure, go ahead ;-) |
Pull request is in: #2417 |
CS should report this as an invalid syntax.
Also, I find it strange that
!
is prepend for all values incase
statament in generated JS.sample
The text was updated successfully, but these errors were encountered: