[wp-trac] [WordPress Trac] #32911: Review Customizer Nav Menus JS

WordPress Trac noreply at wordpress.org
Tue Jul 7 22:18:03 UTC 2015


#32911: Review Customizer Nav Menus JS
----------------------------+-----------------------------
 Reporter:  wonderboymusic  |       Owner:  wonderboymusic
     Type:  defect (bug)    |      Status:  assigned
 Priority:  normal          |   Milestone:  4.3
Component:  Customize       |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:  javascript
----------------------------+-----------------------------

Comment (by westonruter):

 > * Almost all of these functions are static helper methods, do any of
 them need to exposed publicly? We have gotten into a bad habit of
 globalizing all of our JS, which has made BC a living hell when we want to
 use things like `browserify`. I would expose as little as possible
 everywhere.

 By exposing these publicly, we can unit test them (which still needs to be
 done, per #32688). So that's an advantage.

 > * `self` is a bad local variable name. Sometimes `self` is a substitute
 for `this` when scope is lost in a maze of callbacks, but most of the
 time, it just makes `this` more ambiguous than it already is.

 Agreed. We should use `setting`, `control`, or some other name that is
 more semantic.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32911#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list