function Enum(name, values, options, comment, comments) {
        ReflectionObject.call(this, name, options);

        if (values && typeof values !== "object")
          throw TypeError("values must be an object");

        /**
         * Enum values by id.
         * @type {Object.<number,string>}
         */
        this.valuesById = {};

        /**
         * Enum values by name.
         * @type {Object.<string,number>}
         */
        this.values = Object.create(this.valuesById); // toJSON, marker

        /**
         * Enum comment text.
         * @type {string|null}
         */
        this.comment = comment;

        /**
         * Value comment texts, if any.
         * @type {Object.<string,string>}
         */
        this.comments = comments || {};

        /**
         * Reserved ranges, if any.
         * @type {Array.<number[]|string>}
         */
        this.reserved = undefined; // toJSON

        // Note that values inherit valuesById on their prototype which makes them a TypeScript-
        // compatible enum. This is used by pbts to write actual enum definitions that work for
        // static and reflection code alike instead of emitting generic object definitions.

        if (values)
          for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)
            if (typeof values[keys[i]] === "number")
              // use forward entries only
              this.valuesById[(this.values[keys[i]] = values[keys[i]])] =
                keys[i];
      }
/**
       * Constructs a new enum instance.
       * @classdesc Reflected enum.
       * @extends ReflectionObject
       * @constructor
       * @param {string} name Unique name within its namespace
       * @param {Object.<string,number>} [values] Enum values as an object, by name
       * @param {Object.<string,*>} [options] Declared options
       * @param {string} [comment] The comment for this enum
       * @param {Object.<string,string>} [comments] The value comments for this enum
       */
Constructs a new enum instance.
@classdesc Reflected enum.
Constructs a new enum instance . @classdesc Reflected enum .
function Enum(name, values, options, comment, comments) {
        ReflectionObject.call(this, name, options);
        if (values && typeof values !== "object")
          throw TypeError("values must be an object");
        this.valuesById = {};
        this.values = Object.create(this.valuesById); 
        this.comment = comment;
        this.comments = comments || {};
        this.reserved = undefined; 
        if (values)
          for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)
            if (typeof values[keys[i]] === "number")
              this.valuesById[(this.values[keys[i]] = values[keys[i]])] =
                keys[i];
      }
function Enum ( name , values , options , comment , comments ) { ReflectionObject . call ( this , name , options ) ; if ( values && typeof values !== "object" ) throw TypeError ( "values must be an object" ) ; this . valuesById = { } ; this . values = Object . create ( this . valuesById ) ; this . comment = comment ; this . comments = comments || { } ; this . reserved = undefined ; if ( values ) for ( var keys = Object . keys ( values ) , i = 0 ; i < keys . length ; ++ i ) if ( typeof values [ keys [ i ] ] === "number" ) this . valuesById [ ( this . values [ keys [ i ] ] = values [ keys [ i ] ] ) ] = keys [ i ] ; }
Constructs a new enum instance.
Constructs a new enum instance .
/**
         * Enum values by id.
         * @type {Object.<number,string>}
         */ /**
         * Enum values by name.
         * @type {Object.<string,number>}
         */ // toJSON, marker /**
         * Enum comment text.
         * @type {string|null}
         */ /**
         * Value comment texts, if any.
         * @type {Object.<string,string>}
         */ /**
         * Reserved ranges, if any.
         * @type {Array.<number[]|string>}
         */ // toJSON // Note that values inherit valuesById on their prototype which makes them a TypeScript- // compatible enum. This is used by pbts to write actual enum definitions that work for // static and reflection code alike instead of emitting generic object definitions. // use forward entries only