[wp-trac] [WordPress Trac] #22113: Checking for the 'wp' JavaScript variable could be simpler
WordPress Trac
wp-trac at lists.automattic.com
Sat Oct 6 00:33:41 UTC 2012
#22113: Checking for the 'wp' JavaScript variable could be simpler
-----------------------------+-------------------------
Reporter: evansolomon | Type: enhancement
Status: new | Priority: normal
Milestone: Awaiting Review | Component: General
Version: | Severity: normal
Keywords: |
-----------------------------+-------------------------
In a few places we do this:
{{{
if ( typeof wp === 'undefined' )
var wp = {};
}}}
That could be simplified to a one liner that's easier to read:
{{{
window.wp = window.wp || {};
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22113>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list