Commit 42aa135
events: add hasEventListener util for validate
There was some repetitive logics that validated the existence of
eventlisteners. We now replace this with a single line of,
`hasEventListener(self, type)`.
`self` is the object(e.g. EventEmitter) to be checked whether
eventlisteners exists or not.
`type` is the type of eventlisteners, which can be `undefined`
PR-URL: #55230
Reviewed-By: Jason Zhang <[email protected]>1 parent 31ce1f3 commit 42aa135
1 file changed
+12
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
290 | 296 | | |
291 | 297 | | |
292 | 298 | | |
| |||
680 | 686 | | |
681 | 687 | | |
682 | 688 | | |
683 | | - | |
684 | | - | |
| 689 | + | |
685 | 690 | | |
686 | 691 | | |
| 692 | + | |
687 | 693 | | |
688 | | - | |
689 | | - | |
690 | 694 | | |
691 | 695 | | |
692 | 696 | | |
| |||
740 | 744 | | |
741 | 745 | | |
742 | 746 | | |
743 | | - | |
744 | | - | |
| 747 | + | |
745 | 748 | | |
| 749 | + | |
746 | 750 | | |
747 | 751 | | |
748 | 752 | | |
| |||
787 | 791 | | |
788 | 792 | | |
789 | 793 | | |
790 | | - | |
791 | | - | |
792 | | - | |
| 794 | + | |
793 | 795 | | |
794 | 796 | | |
795 | | - | |
796 | | - | |
797 | | - | |
| 797 | + | |
798 | 798 | | |
799 | 799 | | |
800 | 800 | | |
| |||
0 commit comments