[wp-trac] [WordPress Trac] #19592: Automate script and style compression and bumps
WordPress Trac
wp-trac at lists.automattic.com
Mon Mar 26 17:08:10 UTC 2012
#19592: Automate script and style compression and bumps
-------------------------+------------------
Reporter: nacin | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.4
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+------------------
Comment (by mbijon):
Thanks for the guidance, that should make it easy (easier?) to refactor
enough to fix many of those warnings.
Replying to [comment:29 azaozz]:
>
> These actually should be:
>
> {{{
> var useWindow = false, coordinates = {}, x = 0, y = 0;
> }}}
>
> Note the spaces around the `=` and the shorthand for defining new
object.
I like the object-creation shorthand. Not sure if that's part of this YUI
package but will test later.
> > The standard I've seen more often is from JSLint/Crockford and also
happens to match WP's trend toward more-readable code...
>
> Don't think repeating `var` on each line makes it more readable but
that's just a personal opinion. It makes it to look more like a PHP class
declaration, not JS. In WP almost all JS vars are defined on the same line
with one `var` and that's from before we started using YUI.
One line is fine by me. I'm not a fan of declaring `var` inline or as-
needed, ven if the block of declarations has conditionally un-used `vars
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19592#comment:30>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list