onMenuToggle exists in the parent class, but it's blindly overridden with duplication of some (but not all!) of the parent's logic, and it's bound again in the constructor. This means that it runs twice, and that the code for counting how many times the highlight button has been shown double-counts every instance of the menu opening.
Related Gerrit Patches:
|mediawiki/core : master||RC Filters: don't bind onMenuToggle twice|