Follow-up of #1664940: [Policy, patch] Decide on JSHint configuration and part of #1415788: Javascript winter clean-up

Run jshint on the files with the configuration from the parent issue or use jshint.com with the following options:

/*jshint forin:true, noarg:true, eqeqeq:true, undef:true, curly:true, browser:true, expr:true, latedef:true, newcap:true, trailing:true */
/*global Drupal, jQuery */

Fix any warnings or errors the tool finds.
Check manually that the fixes did not break any functionalities
Create patch and upload for the testbot.

Files: toolbar/toolbar.js

Files: 
CommentFileSizeAuthor
#15 core-jshint-toolbar-1684876-15.patch1.88 KBnod_
PASSED: [[SimpleTest]]: [MySQL] 56,241 pass(es). View
#11 toolbar.jshint.patch1.8 KBdroplet
PASSED: [[SimpleTest]]: [MySQL] 55,882 pass(es). View
#10 core-jshint-toolbar-1684876-10.patch2.26 KBnod_
PASSED: [[SimpleTest]]: [MySQL] 56,079 pass(es). View
#3 toolbar.patch936 bytesdroplet
PASSED: [[SimpleTest]]: [MySQL] 53,866 pass(es). View

Comments

nod_’s picture

Status: Active » Closed (works as designed)
nod_’s picture

Status: Closed (works as designed) » Needs work
core/modules/toolbar/js/toolbar.js: line 58, col 9, The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.
droplet’s picture

Status: Needs work » Needs review
Issue tags: +Quick fix
FileSize
936 bytes
PASSED: [[SimpleTest]]: [MySQL] 53,866 pass(es). View
nod_’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Quick fix

thanks

nod_’s picture

Issue tags: +Quick fix

oups

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 560b809 and pushed to 8.x. Thanks!

tim.plunkett’s picture

This broke toolbar in vertical mode. Fix is over in #1968328: Expandable children are gone from vertical toolbar.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nod_’s picture

Status: Closed (fixed) » Needs work

New JSHint config #1995996: Update JSHint configuration.

core/modules/toolbar/js/toolbar.menu.js: line 38, col 15, 'href' is defined but never used.

core/modules/toolbar/js/toolbar.js: line 181, col 13, 'height' is defined but never used.
core/modules/toolbar/js/toolbar.js: line 231, col 12, '$tray' is defined but never used.
core/modules/toolbar/js/toolbar.js: line 248, col 21, 'oldOrientation' is defined but never used.
nod_’s picture

Status: Needs work » Needs review
FileSize
2.26 KB
PASSED: [[SimpleTest]]: [MySQL] 56,079 pass(es). View
droplet’s picture

FileSize
1.8 KB
PASSED: [[SimpleTest]]: [MySQL] 55,882 pass(es). View
droplet’s picture

#10 RTBC. :)

nod_’s picture

Status: Needs review » Reviewed & tested by the community

yeah, you're right. Better keep it JSHint-only. Thanks.

( edit ) haha that's a fun cross-post. I'll leave the jshint overlay issue alone :p

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

This still appears to need work...

jshint core/modules/toolbar/js/
core/modules/toolbar/js/toolbar.js: line 228, col 14, '$button' is defined but never used.

1 error
nod_’s picture

Status: Needs work » Needs review
FileSize
1.88 KB
PASSED: [[SimpleTest]]: [MySQL] 56,241 pass(es). View

d'oh!

removing $tray meant the $button variable is not used anymore. that'll teach me.

nod_’s picture

Status: Needs review » Reviewed & tested by the community

ok with patch applied no more jshint errors for the file

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 60e162c and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.