[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 01:02:06 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 pento):

 Would it be better to test that `obj` is the type of thing we want, rather
 than testing the function? It took me a while to understand what the
 problem was and why [attachment:"44526.diff"] fixed it.

 For example, the `addHoverClass()` function a little further below
 `addEvent()` tests that the `t` parameter exists before it's used.

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


More information about the wp-trac mailing list