#25864 closed enhancement (fixed)
jshint shouldn't throw errors - wp-admin/revisions.js
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.8 | Priority: | normal |
Severity: | normal | Version: | 3.8 |
Component: | Build/Test Tools | Keywords: | has-patch |
Focuses: | Cc: |
Description
The file wp-admin/revisions.js throws many errors in the jshint section of the build process.
The errors generated are:
W116: Expected '{' and instead saw ... - thrown in the many places where curly brackets are omitted from single line if/else blocks
W081: Too many var statements. - thrown in several places where var is used separately in a single function block instead of being combined into a single var statement at the top of the function
W117: ? is not defined. (Backbone, '_' Underscore, _wpRevisionsSettings) thrown for variables that are defined/passed from external sources; also several spots where var declaration missing ahead of variable use
W098: ? is defined but never used. - thrown where function signatures include variables that are never used and are therefore not needed
Attachments (1)
Change History (6)
#1
@
11 years ago
As a check (per azaozz's suggestion), I compared the minified versions of the original and patched files (kaleidoscope helpful since its all one line). differences were minimal: better variable name optimization where variables now declared properly. the one other change was that I switched console reference to window.console to clear errors - the other approach would be to add console to the file's global declaration.
fix jshint for revisions.js