WordPress.org

Make WordPress Core

#25994 closed defect (bug) (fixed)

jshint shouldn't throw errors: wp-admin/js/post.js

Reported by: atimmer Owned by: nacin
Milestone: 3.8 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Focuses: Cc:

Description

51 errors to fix.

Attachments (1)

25994.1.diff (9.8 KB) - added by atimmer 16 months ago.

Download all attachments as: .zip

Change History (4)

@atimmer16 months ago

comment:1 @atimmer16 months ago

25994.1.diff brings it down to 2 errors, which are two functions defined in an if statement. I didn't want to interfere with these changes so I left them out.

When this patch lands I will make a patch to move the functions.

comment:2 @nacin16 months ago

  • Milestone changed from Awaiting Review to 3.8

Basically, functions shouldn't be defined within blocks because weird behavior can occur based on the JS interpreter. Best thing to do is use a function expression, which is fine.

comment:3 @nacin16 months ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 26204:

Fix JSHint errors in post.js.

props atimmer.
fixes #25994.

Note: See TracTickets for help on using tickets.