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

Incorrect use of || operator #75

Open
shicks opened this issue Dec 8, 2018 · 0 comments
Open

Incorrect use of || operator #75

shicks opened this issue Dec 8, 2018 · 0 comments

Comments

@shicks
Copy link

shicks commented Dec 8, 2018

var filename = '' || opt_params['filename'];

I added a lint check for suspicious code and turned up this issue. Probably the operands wanted to be in the opposite direction so that a missing filename option would default to the empty string rather than undefined. But as it's written, the '' is always falsy so it just evaluates to undefined if no filename is given.

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

No branches or pull requests

1 participant