docs: function outputAll( code, moduleName ) {
      try {
          let out = outputComments( code );
          out += "  module.exports = function() {\n";
          out += outputNeededConstants( code );
          out += `    //-------------------
      // Class definition.
      const ViewClass = function( args ) {
        try {
          if( typeof args === 'undefined' ) args = {};
          this.$elements = {};
          ${outputClassBody(code)}
        }
        catch( ex ) {
          console.error('${moduleName}', ex);
          throw Error('Instantiation error in XJS of ${JSON.stringify(moduleName)}:\\n' + ex)
        }
      };\n`;
          out += generate( code.section.statics, "Static members.", "    " );
          out += "    return ViewClass;\n";
          out += "  }();\n";
          return out;
      } catch ( ex ) {
          bubble( ex, "outputAll()" );
          return null;
      }
  }