mozilla/addon-sdk — pull request #779 by Mossop (2013-02-10 01:10:22+00:00)
Title: Bug 839814: Returning undefined from a context listener should hide the menu item.

This has one other fix. When a context listener returns an empty string we hide the menu but don't change the label. Labels should never be able to be empty. This is a slight change to the old context-menu module which would throw an exception and behave randomly in this case so I think it's safe to say no-one is using it and this new behaviour seems sane.

Also threw in a bunch of tests for the odd case where there are multiple context listeners and making sure that we do the right thing there (verified against the old context-menu).