Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#45810 closed enhancement (fixed)

JavaScript type comparison should not lead to a type coercion

Reported by: subrataemfluence's profile subrataemfluence Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: normal Version: 5.0.2
Component: Administration Keywords: has-patch 2nd-opinion
Focuses: javascript, coding-standards Cc:

Description

Although typeof jQuery!='undefined' would not lead to any type conversion I think it is always better to be on a safer side by writing it as typeof jQuey !== 'undefined'.

I hope this will make the type comparison more concrete.

Attachments (1)

45810.diff (941 bytes) - added by subrataemfluence 6 years ago.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
6 years ago

  • Component changed from General to Administration
  • Focuses javascript added

#2 @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#3 @SergeyBiryukov
5 years ago

  • Milestone changed from Future Release to 5.5

#4 follow-up: @SergeyBiryukov
5 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 48083:

Coding Standards: Use strict comparison for JS fragment in wp-admin/admin-header.php.

Props subrataemfluence.
Fixes #45810.

#5 in reply to: ↑ 4 @subrataemfluence
5 years ago

Thank you @SergeyBiryukov
Replying to SergeyBiryukov:

In 48083:

Coding Standards: Use strict comparison for JS fragment in wp-admin/admin-header.php.

Props subrataemfluence.
Fixes #45810.

Note: See TracTickets for help on using tickets.