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

Use Javascript strict mode #9959

Merged
merged 3 commits into from
Dec 20, 2018
Merged

Use Javascript strict mode #9959

merged 3 commits into from
Dec 20, 2018

Conversation

Chocobo1
Copy link
Member

@Chocobo1 Chocobo1 commented Dec 3, 2018

@Piccirello
I plan to merge this after these PRs: #9758, #9752, #9541, #9375, you probably don't want to hold on them any longer.

@Chocobo1 Chocobo1 added WebUI WebUI-related issues/changes Code cleanup Clean up the code while preserving the same outcome and removed WebUI WebUI-related issues/changes labels Dec 3, 2018
@Piccirello
Copy link
Member

Piccirello commented Dec 3, 2018

I'll add strict mode to any new files in those listed PRs. I also want to test this PR out a bit

@Chocobo1 Chocobo1 force-pushed the strict branch 2 times, most recently from f01adc7 to 7b261c4 Compare December 8, 2018 07:04
@Chocobo1
Copy link
Member Author

Chocobo1 commented Dec 8, 2018

@Piccirello
I'm seeing this error, no idea what is causing it...
TypeError: can't assign to property "className" on 3: not an object client.js:296:17

@Piccirello
Copy link
Member

I looked into it some more, I think this is caused by buggy code. Line 290 should probably be for (var i = 0; i < childrens.length; ++i) { so that the function can iterate over the array's indices; rather than all of the properties of the array (which also includes the indices).

@Chocobo1
Copy link
Member Author

Chocobo1 commented Dec 8, 2018

I think this is caused by buggy code.

Nice, now the error is gone! Thanks!

Piccirello
Piccirello previously approved these changes Dec 9, 2018
@Chocobo1
Copy link
Member Author

PR updated, added a commit for code reformatting.

@Piccirello
Copy link
Member

Great PR btw, very happy to see this us move to use strict. Did you use uncrustify for the JS formatting?

@Chocobo1
Copy link
Member Author

Great PR btw, very happy to see this us move to use strict.

I think I defer it after v4.1.5 release, don't want bug slipping in breaking webui users.

Did you use uncrustify for the JS formatting?

I used https://github.com/beautify-web/js-beautify, the config file is at src\webui\www.jsbeautifyrc

@Chocobo1 Chocobo1 merged commit 25cefee into qbittorrent:master Dec 20, 2018
@Chocobo1 Chocobo1 deleted the strict branch December 20, 2018 12:16
@Chocobo1
Copy link
Member Author

@Piccirello
Thanks for the help!

@sledgehammer999
Please don't pick this into v4.1.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code cleanup Clean up the code while preserving the same outcome
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants