build/components_concat.js
function(field, contents) {
            if (!field.map)
                throw Error("field is not a map");

            /**
             * The field corresponding to this map.
             * @type {!ProtoBuf.Reflect.Field}
             */
            this.field = field;

            /**
             * Element instance corresponding to key type.
             * @type {!ProtoBuf.Reflect.Element}
             */
            this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);

            /**
             * Element instance corresponding to value type.
             * @type {!ProtoBuf.Reflect.Element}
             */
            this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);

            /**
             * Internal map: stores mapping of (string form of key) -> (key, value)
             * pair.
             *
             * We provide map semantics for arbitrary key types, but we build on top
             * of an Object, which has only string keys. In order to avoid the need
             * to convert a string key back to its native type in many situations,
             * we store the native key value alongside the value. Thus, we only need
             * a one-way mapping from a key type to its string form that guarantees
             * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1
             * === K2).
             *
             * @type {!Object<string, {key: *, value: *}>}
             */
            this.map = {};

            /**
             * Returns the number of elements in the map.
             */
            Object.defineProperty(this, "size", {
                get: function() { return Object.keys(this.map).length; }
            });

            // Fill initial contents from a raw object.
            if (contents) {
                var keys = Object.keys(contents);
                for (var i = 0; i < keys.length; i++) {
                    var key = this.keyElem.valueFromString(keys[i]);
                    var val = this.valueElem.verifyValue(contents[keys[i]]);
                    this.map[this.keyElem.valueToString(key)] =
                        { key: key, value: val };
                }
            }
        }
function(field, contents) {
            if (!field.map)
                throw Error("field is not a map");

            /**
             * The field corresponding to this map.
             * @type {!ProtoBuf.Reflect.Field}
             */
            this.field = field;

            /**
             * Element instance corresponding to key type.
             * @type {!ProtoBuf.Reflect.Element}
             */
            this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);

            /**
             * Element instance corresponding to value type.
             * @type {!ProtoBuf.Reflect.Element}
             */
            this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);

            /**
             * Internal map: stores mapping of (string form of key) -> (key, value)
             * pair.
             *
             * We provide map semantics for arbitrary key types, but we build on top
             * of an Object, which has only string keys. In order to avoid the need
             * to convert a string key back to its native type in many situations,
             * we store the native key value alongside the value. Thus, we only need
             * a one-way mapping from a key type to its string form that guarantees
             * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1
             * === K2).
             *
             * @type {!Object<string, {key: *, value: *}>}
             */
            this.map = {};

            /**
             * Returns the number of elements in the map.
             */
            Object.defineProperty(this, "size", {
                get: function() { return Object.keys(this.map).length; }
            });

            // Fill initial contents from a raw object.
            if (contents) {
                var keys = Object.keys(contents);
                for (var i = 0; i < keys.length; i++) {
                    var key = this.keyElem.valueFromString(keys[i]);
                    var val = this.valueElem.verifyValue(contents[keys[i]]);
                    this.map[this.keyElem.valueToString(key)] =
                        { key: key, value: val };
                }
            }
        }
function ( field , contents ) { if ( ! field . map ) throw Error ( "field is not a map" ) ; /**
             * The field corresponding to this map.
             * @type {!ProtoBuf.Reflect.Field}
             */ this . field = field ; /**
             * Element instance corresponding to key type.
             * @type {!ProtoBuf.Reflect.Element}
             */ this . keyElem = new Reflect . Element ( field . keyType , null , true , field . syntax ) ; /**
             * Element instance corresponding to value type.
             * @type {!ProtoBuf.Reflect.Element}
             */ this . valueElem = new Reflect . Element ( field . type , field . resolvedType , false , field . syntax ) ; /**
             * Internal map: stores mapping of (string form of key) -> (key, value)
             * pair.
             *
             * We provide map semantics for arbitrary key types, but we build on top
             * of an Object, which has only string keys. In order to avoid the need
             * to convert a string key back to its native type in many situations,
             * we store the native key value alongside the value. Thus, we only need
             * a one-way mapping from a key type to its string form that guarantees
             * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1
             * === K2).
             *
             * @type {!Object<string, {key: *, value: *}>}
             */ this . map = { } ; /**
             * Returns the number of elements in the map.
             */ Object . defineProperty ( this , "size" , { get : function ( ) { return Object . keys ( this . map ) . length ; } } ) ; // Fill initial contents from a raw object.
 if ( contents ) { var keys = Object . keys ( contents ) ; for ( var i = 0 ; i < keys . length ; i ++ ) { var key = this . keyElem . valueFromString ( keys [ i ] ) ; var val = this . valueElem . verifyValue ( contents [ keys [ i ] ] ) ; this . map [ this . keyElem . valueToString ( key ) ] = { key : key , value : val } ; } } }
Constructs a new Map. A Map is a container that is used to implement map
fields on message objects. It closely follows the ES6 Map API; however,
it is distinct because we do not want to depend on external polyfills or
on ES6 itself.

@exports ProtoBuf.Map
@param {!ProtoBuf.Reflect.Field} field Map field
@param {Object.<string,*>=} contents Initial contents
@constructor
Constructs a new Map . A Map is a container that is used to implement map fields on message objects . It closely follows the ES6 Map API ; however it is distinct because we do not want to depend on external polyfills or on ES6 itself .