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

Prevent jsLint and Closure Compiler Warnings #93

Closed
alphanull opened this Issue May 28, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@alphanull

alphanull commented May 28, 2013

There is some code in URI.js, that generates warnings in both jsHint and Closure Compiler.

It happens in lines 1646 and 1651:

for (i = 0, p; p = properties[i]; i++) {

CC complains: "WARNING - Suspicious code. This code lacks side-effects. Is there a bug". Since you defined "p" beforehand, you could ommit this declaration in the loop.

Furthermore, jsHint says: "Expected a conditional expression and instead saw an assignment.", because it does not "get" your loop construction, which works, but also can be deemed as a little "funky".

Would be nice if these warnings could be prevented, there shouldn't be much changes needed for that.

@rodneyrehm

This comment has been minimized.

Show comment
Hide comment
@rodneyrehm

rodneyrehm May 29, 2013

Member

yeah, I can fix that. You could too, if you want to send a PR…

Member

rodneyrehm commented May 29, 2013

yeah, I can fix that. You could too, if you want to send a PR…

@alphanull

This comment has been minimized.

Show comment
Hide comment
@alphanull

alphanull May 29, 2013

Actually that would be my first PR ;) But yes, I can try to do that. Might take a few days, though.

alphanull commented May 29, 2013

Actually that would be my first PR ;) But yes, I can try to do that. Might take a few days, though.

@rodneyrehm

This comment has been minimized.

Show comment
Hide comment
@rodneyrehm

rodneyrehm Aug 3, 2013

Member

I've merged this into master - it will be included in the next release. thank you for your help!

Member

rodneyrehm commented Aug 3, 2013

I've merged this into master - it will be included in the next release. thank you for your help!

@rodneyrehm rodneyrehm closed this Aug 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment