code: function subscribe(instance) {
        var name = instance.getName();
  
        if (menus.get(name)) {
          console.warn("incorrect usage of popup menu - menu with name ".concat(name, " already exists"));
        }
  
        menus.set(name, {
          name: name,
          instance: instance
        });
      }
docs: Subscribes menu instance.