[wp-trac] [WordPress Trac] #44526: Admin Bar: Fail gracefully when adding events to non-existent elements

WordPress Trac noreply at wordpress.org
Tue Jul 17 11:41:47 UTC 2018


#44526: Admin Bar: Fail gracefully when adding events to non-existent elements
--------------------------+-------------------------
 Reporter:  obenland      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  low           |   Milestone:  5.0
Component:  Toolbar       |     Version:  3.1
 Severity:  minor         |  Resolution:
 Keywords:                |     Focuses:  javascript
--------------------------+-------------------------

Comment (by obenland):

 I don't think I necessarily have a preference either way.

 For argument's sake, in `addEvent()` we don't care what `obj` is as long
 as we're able to attach events to it.

 Do you feel like testing for `obj` first would make the code clearer?

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


More information about the wp-trac mailing list