addGenerator = function (label, generator, language) {
        if (!label || !generator) {
          throw Error('usage: addGenerator(label, generator, language?);');
        }
        tabs[label] = registerGenerator(
          label,
          language || 'javascript',
          (ws) => generator.workspaceToCode(ws),
          true,
        );
        if (activeTab === label) {
          // Set the new generator as the current tab if it is currently
          // active. This occurs when a dynamically added generator is active
          // and the page is reloaded.
          setActiveTab(tabs[label]);
        }
      }
Add a generator tab.
@param {string} label The label of the generator tab.
@param {Blockly.Generator} generator The Blockly generator.
@param {string=} language Optional editor language, defaults to
    'javascript'.