Skip to content
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

Simplify conditions #1076

Closed
wants to merge 1 commit into from
Closed

Simplify conditions #1076

wants to merge 1 commit into from

Conversation

charmander
Copy link
Collaborator

Not very important, might be counter to the preferred style, but may as well ask?

@brianc
Copy link
Owner

brianc commented Jul 14, 2016

Hey @charmander I appreciate the thought & effort, but I'm reticent to change any of the if conditions comparing strictly to null and undefined to a more lax double equals falsy check. That can subtly change semantics & behavior that might not be properly covered in tests, and start causing weird unexpected breakages. I think the CBA on this change is pointing towards potentially higher negative impact & cost than the minor stylistic changes.

@charmander
Copy link
Collaborator Author

x == null is different from typical == checks in that it’s exactly the same as x === null || x === undefined, which is why JSHint has an option to allow it specifically. But it is a style choice, so I can take those changes out if you want.

@brianc
Copy link
Owner

brianc commented Aug 11, 2016

I appreciate the thought here, but I'm gonna close this as it doesn't really add anything specific. There are a lot of open bugs that need my attention & doing logic refactorings is additional overhead I unfortuantely don't have cycles for right now! If you'd like to pop some issues off the list & PR for those that'd be greatly appreciated! Any logic fixed during those w/ supporting test coverage ofcourse is totally fine. 😄

@brianc brianc closed this Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants