#25957 closed defect (bug) (fixed)
jshint shouldn't throw errors: wp-includes/js/utils.js
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | needs-patch |
Focuses: | Cc: |
Description
fixing these:
Linting src/wp-includes/js/utils.js ...ERROR [L67:C56] W109: Strings must use singlequote. var cookie = document.cookie, e, p = name + "=", b; Linting src/wp-includes/js/utils.js ...ERROR [L72:C32] W109: Strings must use singlequote. b = cookie.indexOf("; " + p); Linting src/wp-includes/js/utils.js ...ERROR [L77:C20] W041: Use '!==' to compare with '0'. if ( b != 0 ) Linting src/wp-includes/js/utils.js ...ERROR [L84:C31] W109: Strings must use singlequote. e = cookie.indexOf(";", b); Linting src/wp-includes/js/utils.js ...ERROR [L110:C37] W109: Strings must use singlequote. document.cookie = name + "=" + encodeURIComponent(value) + Linting src/wp-includes/js/utils.js ...ERROR [L111:C38] W109: Strings must use singlequote. ((expires) ? "; expires=" + expires : "") + Linting src/wp-includes/js/utils.js ...ERROR [L111:C53] W109: Strings must use singlequote. ((expires) ? "; expires=" + expires : "") + Linting src/wp-includes/js/utils.js ...ERROR [L112:C32] W109: Strings must use singlequote. ((path) ? "; path=" + path : "") + Linting src/wp-includes/js/utils.js ...ERROR [L112:C44] W109: Strings must use singlequote. ((path) ? "; path=" + path : "") + Linting src/wp-includes/js/utils.js ...ERROR [L113:C36] W109: Strings must use singlequote. ((domain) ? "; domain=" + domain : "") + Linting src/wp-includes/js/utils.js ...ERROR [L113:C50] W109: Strings must use singlequote. ((domain) ? "; domain=" + domain : "") + Linting src/wp-includes/js/utils.js ...ERROR [L114:C35] W109: Strings must use singlequote. ((secure) ? "; secure" : ""); Linting src/wp-includes/js/utils.js ...ERROR [L114:C40] W109: Strings must use singlequote. ((secure) ? "; secure" : ""); Linting src/wp-includes/js/utils.js ...ERROR [L146:C35] W117: 'userSettings' is not defined. var cookie = 'wp-settings-' + userSettings.uid, all = wpCookies.getHash(cookie) || {}, path = userSettings.url, Linting src/wp-includes/js/utils.js ...ERROR [L146:C99] W117: 'userSettings' is not defined. var cookie = 'wp-settings-' + userSettings.uid, all = wpCookies.getHash(cookie) || {}, path = userSettings.url, Linting src/wp-includes/js/utils.js ...ERROR [L156:C39] W117: 'userSettings' is not defined. wpCookies.set('wp-settings-time-'+userSettings.uid, userSettings.time, 31536000, path); Linting src/wp-includes/js/utils.js ...ERROR [L156:C57] W117: 'userSettings' is not defined. wpCookies.set('wp-settings-time-'+userSettings.uid, userSettings.time, 31536000, path); Linting src/wp-includes/js/utils.js ...ERROR [L170:C47] W117: 'userSettings' is not defined. return wpCookies.getHash('wp-settings-' + userSettings.uid) || {}; Linting src/wp-includes/js/utils.js ...ERROR [L128:C24] W098: 'getUserSetting' is defined but never used. function getUserSetting( name, def ) { Linting src/wp-includes/js/utils.js ...ERROR [L161:C27] W098: 'deleteUserSetting' is defined but never used. function deleteUserSetting( name ) {
Attachments (1)
Change History (6)
#1
@
11 years ago
25957.diff changes:
- swap double for single quotes
- add globals
- add jshint config don't check undefined: functions used elsewhere in core
- change != 0 to !== 0 @L80
#2
follow-up:
↓ 4
@
11 years ago
- Milestone changed from Awaiting Review to 3.8
Looks good. We can used exported
instead of unused.
#3
@
11 years ago
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed
In 26203:
Note: See
TracTickets for help on using
tickets.
clear jshint errors