diff --git a/README.md b/README.md index bce287dd9..3be9e8e23 100644 --- a/README.md +++ b/README.md @@ -345,7 +345,7 @@ pbjs.main([ "--target", "json-module", "path/to/myproto.proto" ], function(err, ### Descriptors vs. static modules -While .proto and JSON files require the full library (about 17.5kb gzipped), pretty much all code but the relatively short descriptors is shared and all features including reflection and the parser are available. +While .proto and JSON files require the full library (about 18.5kb gzipped), pretty much all code but the relatively short descriptors is shared and all features including reflection and the parser are available. Static code, on the other hand, requires just the minimal runtime (about 5.5kb gzipped), but generates additional, albeit editable, source code without any reflection features. diff --git a/cli/targets/static.js b/cli/targets/static.js index 8ec87e708..5d5da67ee 100644 --- a/cli/targets/static.js +++ b/cli/targets/static.js @@ -176,9 +176,14 @@ function buildFunction(type, functionName, gen, scope) { delete scope[key]; }); + var hasScope = Object.keys(scope).length; + // enclose all but the first and last line in an iife returning our properly scoped function var lines = code.split(/\n/g); - push(name(type.name) + "." + functionName + " = (function(" + Object.keys(scope).join(", ") + ") { return " + lines[0]); + if (hasScope) + push(name(type.name) + "." + functionName + " = (function(" + Object.keys(scope).join(", ") + ") { return " + lines[0]); + else + push(name(type.name) + "." + functionName + " = " + lines[0]); lines.slice(1, lines.length - 1).forEach(function(line) { var prev = indent; var i = 0; @@ -187,7 +192,10 @@ function buildFunction(type, functionName, gen, scope) { push(line.trim()); indent = prev; }); - push("};})(" + Object.keys(scope).map(function(key) { return scope[key]; }).join(", ") + ");"); + if (hasScope) + push("};})(" + Object.keys(scope).map(function(key) { return scope[key]; }).join(", ") + ");"); + else + push("};"); } function toJsType(field) { @@ -246,14 +254,8 @@ function buildType(ref, type) { --indent; push("}"); - if (type.fieldsArray.length || type.oneofsArray.length || config.convert) { - push(""); - if (config.comments) - push("/** @alias " + fullName + ".prototype */"); - push("var $prototype = " + name(type.name) + ".prototype;"); - } - // default values + var firstField = true; type.fieldsArray.forEach(function(field) { field.resolve(); var jsType = toJsType(field); @@ -269,21 +271,24 @@ function buildType(ref, type) { prop.charAt(0) !== "." ? "@name " + fullName + "#" + field.name : null, "@type {" + jsType + "}" ]); + } else if (firstField) { + push(""); + firstField = false; } if (field.repeated) - push("$prototype" + prop + " = $protobuf.util.emptyArray;"); + push(name(type.name) + ".prototype" + prop + " = $protobuf.util.emptyArray;"); else if (field.map) - push("$prototype" + prop + " = $protobuf.util.emptyObject;"); + push(name(type.name) + ".prototype" + prop + " = $protobuf.util.emptyObject;"); else if (field.long) - push("$prototype" + prop + " = $protobuf.util.Long ? $protobuf.util.Long.fromBits(" + push(name(type.name) + ".prototype" + prop + " = $protobuf.util.Long ? $protobuf.util.Long.fromBits(" + JSON.stringify(field.typeDefault.low) + "," + JSON.stringify(field.typeDefault.high) + "," + JSON.stringify(field.typeDefault.unsigned) + ") : " + field.typeDefault.toNumber(field.type.charAt(0) === "u") + ";"); else if (field.bytes) { - push("$prototype" + prop + " = $protobuf.util.newBuffer(" + JSON.stringify(Array.prototype.slice.call(field.typeDefault)) + ");"); + push(name(type.name) + ".prototype" + prop + " = $protobuf.util.newBuffer(" + JSON.stringify(Array.prototype.slice.call(field.typeDefault)) + ");"); } else - push("$prototype" + prop + " = " + JSON.stringify(field.typeDefault) + ";"); + push(name(type.name) + ".prototype" + prop + " = " + JSON.stringify(field.typeDefault) + ";"); }); // virtual oneof fields @@ -303,7 +308,7 @@ function buildType(ref, type) { "@name " + fullName + "#" + name(oneof.name), "@type {string|undefined}" ]); - push("Object.defineProperty($prototype, " + JSON.stringify(oneof.name) +", {"); + push("Object.defineProperty(" + name(type.name) + ".prototype, " + JSON.stringify(oneof.name) +", {"); ++indent; push("get: $protobuf.util.oneOfGetter($oneOfFields = [" + oneof.oneof.map(JSON.stringify).join(", ") + "]),"); push("set: $protobuf.util.oneOfSetter($oneOfFields)"); @@ -323,7 +328,7 @@ function buildType(ref, type) { if (hasTypes && (config.encode || config.decode || config.verify || config.convert)) { push(""); if (config.comments) - push("// Referenced types"); + push("// Lazily resolved referenced types"); push("var $types = {" + types.join(",") + "}; $lazyTypes.push($types);"); } @@ -461,7 +466,7 @@ function buildType(ref, type) { "@param {$protobuf.ConversionOptions} [options] Conversion options", "@returns {Object.} Plain object" ]); - push("$prototype.toObject = function toObject(options) {"); + push(name(type.name) + ".prototype.toObject = function toObject(options) {"); ++indent; push("return this.constructor.toObject(this, options);"); --indent; @@ -472,7 +477,7 @@ function buildType(ref, type) { "Converts this " + type.name + " to JSON.", "@returns {Object.} JSON object" ]); - push("$prototype.toJSON = function toJSON() {"); + push(name(type.name) + ".prototype.toJSON = function toJSON() {"); ++indent; push("return this.constructor.toObject(this, $protobuf.util.toJSONOptions);"); --indent; diff --git a/dist/noparse/protobuf.js b/dist/noparse/protobuf.js index 79f999a15..2d1342f3e 100644 --- a/dist/noparse/protobuf.js +++ b/dist/noparse/protobuf.js @@ -1,6 +1,6 @@ /*! * protobuf.js v6.5.0 (c) 2016, Daniel Wirtz - * Compiled Sat, 14 Jan 2017 21:49:58 UTC + * Compiled Sat, 14 Jan 2017 22:52:07 UTC * Licensed under the BSD-3-Clause License * see: https://github.com/dcodeIO/protobuf.js for details */ diff --git a/dist/noparse/protobuf.min.js b/dist/noparse/protobuf.min.js index 4be982d2a..a4c4d636e 100644 --- a/dist/noparse/protobuf.min.js +++ b/dist/noparse/protobuf.min.js @@ -1,6 +1,6 @@ /*! * protobuf.js v6.5.0 (c) 2016, Daniel Wirtz - * Compiled Sat, 14 Jan 2017 21:49:58 UTC + * Compiled Sat, 14 Jan 2017 22:52:07 UTC * Licensed under the BSD-3-Clause License * see: https://github.com/dcodeIO/protobuf.js for details */ diff --git a/dist/noparse/protobuf.min.js.gz b/dist/noparse/protobuf.min.js.gz index 85ac734f5..93f36f536 100644 Binary files a/dist/noparse/protobuf.min.js.gz and b/dist/noparse/protobuf.min.js.gz differ diff --git a/dist/protobuf.js b/dist/protobuf.js index 7434a24b8..45e192b1c 100644 --- a/dist/protobuf.js +++ b/dist/protobuf.js @@ -1,6 +1,6 @@ /*! * protobuf.js v6.5.0 (c) 2016, Daniel Wirtz - * Compiled Sat, 14 Jan 2017 21:49:58 UTC + * Compiled Sat, 14 Jan 2017 22:52:07 UTC * Licensed under the BSD-3-Clause License * see: https://github.com/dcodeIO/protobuf.js for details */ diff --git a/dist/protobuf.min.js b/dist/protobuf.min.js index 6054b240c..98529cdc0 100644 --- a/dist/protobuf.min.js +++ b/dist/protobuf.min.js @@ -1,6 +1,6 @@ /*! * protobuf.js v6.5.0 (c) 2016, Daniel Wirtz - * Compiled Sat, 14 Jan 2017 21:49:58 UTC + * Compiled Sat, 14 Jan 2017 22:52:07 UTC * Licensed under the BSD-3-Clause License * see: https://github.com/dcodeIO/protobuf.js for details */ diff --git a/dist/protobuf.min.js.gz b/dist/protobuf.min.js.gz index fa0a6af5b..f71b6470e 100644 Binary files a/dist/protobuf.min.js.gz and b/dist/protobuf.min.js.gz differ diff --git a/dist/runtime/protobuf.js b/dist/runtime/protobuf.js index 0b6207408..2c4abaa84 100644 --- a/dist/runtime/protobuf.js +++ b/dist/runtime/protobuf.js @@ -1,6 +1,6 @@ /*! * protobuf.js v6.5.0 (c) 2016, Daniel Wirtz - * Compiled Sat, 14 Jan 2017 21:49:58 UTC + * Compiled Sat, 14 Jan 2017 22:52:07 UTC * Licensed under the BSD-3-Clause License * see: https://github.com/dcodeIO/protobuf.js for details */ diff --git a/dist/runtime/protobuf.min.js b/dist/runtime/protobuf.min.js index 683c3a468..340fea5ec 100644 --- a/dist/runtime/protobuf.min.js +++ b/dist/runtime/protobuf.min.js @@ -1,6 +1,6 @@ /*! * protobuf.js v6.5.0 (c) 2016, Daniel Wirtz - * Compiled Sat, 14 Jan 2017 21:49:58 UTC + * Compiled Sat, 14 Jan 2017 22:52:07 UTC * Licensed under the BSD-3-Clause License * see: https://github.com/dcodeIO/protobuf.js for details */ diff --git a/dist/runtime/protobuf.min.js.gz b/dist/runtime/protobuf.min.js.gz index d7f7a7475..87552bf75 100644 Binary files a/dist/runtime/protobuf.min.js.gz and b/dist/runtime/protobuf.min.js.gz differ diff --git a/tests/data/ambiguous-names.js b/tests/data/ambiguous-names.js index ca680ddcb..b60e55e86 100644 --- a/tests/data/ambiguous-names.js +++ b/tests/data/ambiguous-names.js @@ -25,14 +25,11 @@ $root.A = (function() { } } - /** @alias A.prototype */ - var $prototype = A.prototype; - /** * A whatever. * @type {string} */ - $prototype.whatever = ""; + A.prototype.whatever = ""; /** * Creates a new A instance using the specified properties. @@ -127,13 +124,13 @@ $root.A = (function() { * @param {Object.} object Plain object * @returns {A} A */ - A.fromObject = (function() { return function fromObject(object) { + A.fromObject = function fromObject(object) { var message = new $root.A(); if (object.whatever !== undefined && object.whatever !== null) { message.whatever = String(object.whatever); } return message; - };})(); + }; /** * Creates a A message from a plain object. Also converts values to their respective internal types. @@ -150,7 +147,7 @@ $root.A = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - A.toObject = (function() { return function toObject(message, options) { + A.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -168,14 +165,14 @@ $root.A = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this A message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + A.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -183,7 +180,7 @@ $root.A = (function() { * Converts this A to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + A.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -206,16 +203,13 @@ $root.B = (function() { } } - /** @alias B.prototype */ - var $prototype = B.prototype; - /** * B A. * @type {A} */ - $prototype.A = null; + B.prototype.A = null; - // Referenced types + // Lazily resolved referenced types var $types = {0:"A"}; $lazyTypes.push($types); /** @@ -360,7 +354,7 @@ $root.B = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + B.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -368,7 +362,7 @@ $root.B = (function() { * Converts this B to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + B.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; diff --git a/tests/data/comments.js b/tests/data/comments.js index 6d459a20f..e3e205857 100644 --- a/tests/data/comments.js +++ b/tests/data/comments.js @@ -29,26 +29,23 @@ $root.Test1 = (function() { } } - /** @alias Test1.prototype */ - var $prototype = Test1.prototype; - /** * Field with a comment. * @type {string} */ - $prototype.field1 = ""; + Test1.prototype.field1 = ""; /** * Test1 field2. * @type {number} */ - $prototype.field2 = 0; + Test1.prototype.field2 = 0; /** * Field with a comment. * @type {boolean} */ - $prototype.field3 = false; + Test1.prototype.field3 = false; /** * Creates a new Test1 instance using the specified properties. @@ -167,7 +164,7 @@ $root.Test1 = (function() { * @param {Object.} object Plain object * @returns {Test1} Test1 */ - Test1.fromObject = (function() { return function fromObject(object) { + Test1.fromObject = function fromObject(object) { var message = new $root.Test1(); if (object.field1 !== undefined && object.field1 !== null) { message.field1 = String(object.field1); @@ -179,7 +176,7 @@ $root.Test1 = (function() { message.field3 = Boolean(object.field3); } return message; - };})(); + }; /** * Creates a Test1 message from a plain object. Also converts values to their respective internal types. @@ -196,7 +193,7 @@ $root.Test1 = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Test1.toObject = (function() { return function toObject(message, options) { + Test1.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -228,14 +225,14 @@ $root.Test1 = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this Test1 message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Test1.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -243,7 +240,7 @@ $root.Test1 = (function() { * Converts this Test1 to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Test1.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -266,9 +263,6 @@ $root.Test2 = (function() { } } - /** @alias Test2.prototype */ - var $prototype = Test2.prototype; - /** * Creates a new Test2 instance using the specified properties. * @param {Object} [properties] Properties to set @@ -341,18 +335,18 @@ $root.Test2 = (function() { * @param {Test2|Object} message Test2 message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ - Test2.verify = (function() { return function verify() { + Test2.verify = function verify() { return null; - };})(); + }; /** * Creates a Test2 message from a plain object. Also converts values to their respective internal types. * @param {Object.} object Plain object * @returns {Test2} Test2 */ - Test2.fromObject = (function() { return function fromObject() { + Test2.fromObject = function fromObject() { return new $root.Test2(); - };})(); + }; /** * Creates a Test2 message from a plain object. Also converts values to their respective internal types. @@ -369,16 +363,16 @@ $root.Test2 = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Test2.toObject = (function() { return function toObject() { + Test2.toObject = function toObject() { return {}; - };})(); + }; /** * Creates a plain object from this Test2 message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Test2.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -386,7 +380,7 @@ $root.Test2 = (function() { * Converts this Test2 to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Test2.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; diff --git a/tests/data/convert.js b/tests/data/convert.js index 68c5e568a..46332fe51 100644 --- a/tests/data/convert.js +++ b/tests/data/convert.js @@ -25,64 +25,61 @@ $root.Message = (function() { } } - /** @alias Message.prototype */ - var $prototype = Message.prototype; - /** * Message stringVal. * @type {string} */ - $prototype.stringVal = ""; + Message.prototype.stringVal = ""; /** * Message stringRepeated. * @type {Array.} */ - $prototype.stringRepeated = $protobuf.util.emptyArray; + Message.prototype.stringRepeated = $protobuf.util.emptyArray; /** * Message uint64Val. * @type {number|$protobuf.Long} */ - $prototype.uint64Val = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,true) : 0; + Message.prototype.uint64Val = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,true) : 0; /** * Message uint64Repeated. * @type {Array.} */ - $prototype.uint64Repeated = $protobuf.util.emptyArray; + Message.prototype.uint64Repeated = $protobuf.util.emptyArray; /** * Message bytesVal. * @type {Uint8Array} */ - $prototype.bytesVal = $protobuf.util.newBuffer([]); + Message.prototype.bytesVal = $protobuf.util.newBuffer([]); /** * Message bytesRepeated. * @type {Array.} */ - $prototype.bytesRepeated = $protobuf.util.emptyArray; + Message.prototype.bytesRepeated = $protobuf.util.emptyArray; /** * Message enumVal. * @type {number} */ - $prototype.enumVal = 1; + Message.prototype.enumVal = 1; /** * Message enumRepeated. * @type {Array.} */ - $prototype.enumRepeated = $protobuf.util.emptyArray; + Message.prototype.enumRepeated = $protobuf.util.emptyArray; /** * Message int64Map. * @type {Object.} */ - $prototype.int64Map = $protobuf.util.emptyObject; + Message.prototype.int64Map = $protobuf.util.emptyObject; - // Referenced types + // Lazily resolved referenced types var $types = {6:"Message.SomeEnum",7:"Message.SomeEnum"}; $lazyTypes.push($types); /** @@ -608,7 +605,7 @@ $root.Message = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Message.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -616,7 +613,7 @@ $root.Message = (function() { * Converts this Message to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Message.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; diff --git a/tests/data/mapbox/vector_tile.js b/tests/data/mapbox/vector_tile.js index cf5840108..4230f2556 100644 --- a/tests/data/mapbox/vector_tile.js +++ b/tests/data/mapbox/vector_tile.js @@ -34,16 +34,13 @@ $root.vector_tile = (function() { } } - /** @alias vector_tile.Tile.prototype */ - var $prototype = Tile.prototype; - /** * Tile layers. * @type {Array.} */ - $prototype.layers = $protobuf.util.emptyArray; + Tile.prototype.layers = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {0:"vector_tile.Tile.Layer"}; $lazyTypes.push($types); /** @@ -204,7 +201,7 @@ $root.vector_tile = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Tile.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -212,7 +209,7 @@ $root.vector_tile = (function() { * Converts this Tile to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Tile.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -252,50 +249,47 @@ $root.vector_tile = (function() { } } - /** @alias vector_tile.Tile.Value.prototype */ - var $prototype = Value.prototype; - /** * Value stringValue. * @type {string} */ - $prototype.stringValue = ""; + Value.prototype.stringValue = ""; /** * Value floatValue. * @type {number} */ - $prototype.floatValue = 0; + Value.prototype.floatValue = 0; /** * Value doubleValue. * @type {number} */ - $prototype.doubleValue = 0; + Value.prototype.doubleValue = 0; /** * Value intValue. * @type {number|$protobuf.Long} */ - $prototype.intValue = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,false) : 0; + Value.prototype.intValue = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,false) : 0; /** * Value uintValue. * @type {number|$protobuf.Long} */ - $prototype.uintValue = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,true) : 0; + Value.prototype.uintValue = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,true) : 0; /** * Value sintValue. * @type {number|$protobuf.Long} */ - $prototype.sintValue = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,false) : 0; + Value.prototype.sintValue = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,false) : 0; /** * Value boolValue. * @type {boolean} */ - $prototype.boolValue = false; + Value.prototype.boolValue = false; /** * Creates a new Value instance using the specified properties. @@ -639,7 +633,7 @@ $root.vector_tile = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Value.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -647,7 +641,7 @@ $root.vector_tile = (function() { * Converts this Value to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -670,34 +664,31 @@ $root.vector_tile = (function() { } } - /** @alias vector_tile.Tile.Feature.prototype */ - var $prototype = Feature.prototype; - /** * Feature id. * @type {number|$protobuf.Long} */ - $prototype.id = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,true) : 0; + Feature.prototype.id = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,true) : 0; /** * Feature tags. * @type {Array.} */ - $prototype.tags = $protobuf.util.emptyArray; + Feature.prototype.tags = $protobuf.util.emptyArray; /** * Feature type. * @type {number} */ - $prototype.type = undefined; + Feature.prototype.type = undefined; /** * Feature geometry. * @type {Array.} */ - $prototype.geometry = $protobuf.util.emptyArray; + Feature.prototype.geometry = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {2:"vector_tile.Tile.GeomType"}; $lazyTypes.push($types); /** @@ -1007,7 +998,7 @@ $root.vector_tile = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Feature.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -1015,7 +1006,7 @@ $root.vector_tile = (function() { * Converts this Feature to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Feature.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -1038,46 +1029,43 @@ $root.vector_tile = (function() { } } - /** @alias vector_tile.Tile.Layer.prototype */ - var $prototype = Layer.prototype; - /** * Layer version. * @type {number} */ - $prototype.version = 1; + Layer.prototype.version = 1; /** * Layer name. * @type {string} */ - $prototype.name = ""; + Layer.prototype.name = ""; /** * Layer features. * @type {Array.} */ - $prototype.features = $protobuf.util.emptyArray; + Layer.prototype.features = $protobuf.util.emptyArray; /** * Layer keys. * @type {Array.} */ - $prototype.keys = $protobuf.util.emptyArray; + Layer.prototype.keys = $protobuf.util.emptyArray; /** * Layer values. * @type {Array.} */ - $prototype.values = $protobuf.util.emptyArray; + Layer.prototype.values = $protobuf.util.emptyArray; /** * Layer extent. * @type {number} */ - $prototype.extent = 4096; + Layer.prototype.extent = 4096; - // Referenced types + // Lazily resolved referenced types var $types = {2:"vector_tile.Tile.Feature",4:"vector_tile.Tile.Value"}; $lazyTypes.push($types); /** @@ -1375,7 +1363,7 @@ $root.vector_tile = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Layer.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -1383,7 +1371,7 @@ $root.vector_tile = (function() { * Converts this Layer to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Layer.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; diff --git a/tests/data/package.js b/tests/data/package.js index 91c20145c..189ac0f4b 100644 --- a/tests/data/package.js +++ b/tests/data/package.js @@ -25,112 +25,109 @@ $root.Package = (function() { } } - /** @alias Package.prototype */ - var $prototype = Package.prototype; - /** * Package name. * @type {string} */ - $prototype.name = ""; + Package.prototype.name = ""; /** * Package version. * @type {string} */ - $prototype.version = ""; + Package.prototype.version = ""; /** * Package description. * @type {string} */ - $prototype.description = ""; + Package.prototype.description = ""; /** * Package author. * @type {string} */ - $prototype.author = ""; + Package.prototype.author = ""; /** * Package license. * @type {string} */ - $prototype.license = ""; + Package.prototype.license = ""; /** * Package repository. * @type {Package.Repository} */ - $prototype.repository = null; + Package.prototype.repository = null; /** * Package bugs. * @type {string} */ - $prototype.bugs = ""; + Package.prototype.bugs = ""; /** * Package homepage. * @type {string} */ - $prototype.homepage = ""; + Package.prototype.homepage = ""; /** * Package keywords. * @type {Array.} */ - $prototype.keywords = $protobuf.util.emptyArray; + Package.prototype.keywords = $protobuf.util.emptyArray; /** * Package main. * @type {string} */ - $prototype.main = ""; + Package.prototype.main = ""; /** * Package bin. * @type {Object.} */ - $prototype.bin = $protobuf.util.emptyObject; + Package.prototype.bin = $protobuf.util.emptyObject; /** * Package scripts. * @type {Object.} */ - $prototype.scripts = $protobuf.util.emptyObject; + Package.prototype.scripts = $protobuf.util.emptyObject; /** * Package dependencies. * @type {Object.} */ - $prototype.dependencies = $protobuf.util.emptyObject; + Package.prototype.dependencies = $protobuf.util.emptyObject; /** * Package optionalDependencies. * @type {Object.} */ - $prototype.optionalDependencies = $protobuf.util.emptyObject; + Package.prototype.optionalDependencies = $protobuf.util.emptyObject; /** * Package devDependencies. * @type {Object.} */ - $prototype.devDependencies = $protobuf.util.emptyObject; + Package.prototype.devDependencies = $protobuf.util.emptyObject; /** * Package types. * @type {string} */ - $prototype.types = ""; + Package.prototype.types = ""; /** * Package cliDependencies. * @type {Array.} */ - $prototype.cliDependencies = $protobuf.util.emptyArray; + Package.prototype.cliDependencies = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {5:"Package.Repository"}; $lazyTypes.push($types); /** @@ -763,7 +760,7 @@ $root.Package = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Package.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -771,7 +768,7 @@ $root.Package = (function() { * Converts this Package to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Package.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -791,20 +788,17 @@ $root.Package = (function() { } } - /** @alias Package.Repository.prototype */ - var $prototype = Repository.prototype; - /** * Repository type. * @type {string} */ - $prototype.type = ""; + Repository.prototype.type = ""; /** * Repository url. * @type {string} */ - $prototype.url = ""; + Repository.prototype.url = ""; /** * Creates a new Repository instance using the specified properties. @@ -911,7 +905,7 @@ $root.Package = (function() { * @param {Object.} object Plain object * @returns {Package.Repository} Repository */ - Repository.fromObject = (function() { return function fromObject(object) { + Repository.fromObject = function fromObject(object) { var message = new $root.Package.Repository(); if (object.type !== undefined && object.type !== null) { message.type = String(object.type); @@ -920,7 +914,7 @@ $root.Package = (function() { message.url = String(object.url); } return message; - };})(); + }; /** * Creates a Repository message from a plain object. Also converts values to their respective internal types. @@ -937,7 +931,7 @@ $root.Package = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Repository.toObject = (function() { return function toObject(message, options) { + Repository.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -962,14 +956,14 @@ $root.Package = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this Repository message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Repository.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -977,7 +971,7 @@ $root.Package = (function() { * Converts this Repository to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Repository.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; diff --git a/tests/data/rpc.js b/tests/data/rpc.js index 88be8fb15..7a6696d84 100644 --- a/tests/data/rpc.js +++ b/tests/data/rpc.js @@ -117,14 +117,11 @@ $root.MyRequest = (function() { } } - /** @alias MyRequest.prototype */ - var $prototype = MyRequest.prototype; - /** * MyRequest path. * @type {string} */ - $prototype.path = ""; + MyRequest.prototype.path = ""; /** * Creates a new MyRequest instance using the specified properties. @@ -219,13 +216,13 @@ $root.MyRequest = (function() { * @param {Object.} object Plain object * @returns {MyRequest} MyRequest */ - MyRequest.fromObject = (function() { return function fromObject(object) { + MyRequest.fromObject = function fromObject(object) { var message = new $root.MyRequest(); if (object.path !== undefined && object.path !== null) { message.path = String(object.path); } return message; - };})(); + }; /** * Creates a MyRequest message from a plain object. Also converts values to their respective internal types. @@ -242,7 +239,7 @@ $root.MyRequest = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MyRequest.toObject = (function() { return function toObject(message, options) { + MyRequest.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -260,14 +257,14 @@ $root.MyRequest = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this MyRequest message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + MyRequest.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -275,7 +272,7 @@ $root.MyRequest = (function() { * Converts this MyRequest to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + MyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -298,14 +295,11 @@ $root.MyResponse = (function() { } } - /** @alias MyResponse.prototype */ - var $prototype = MyResponse.prototype; - /** * MyResponse status. * @type {number} */ - $prototype.status = 0; + MyResponse.prototype.status = 0; /** * Creates a new MyResponse instance using the specified properties. @@ -400,13 +394,13 @@ $root.MyResponse = (function() { * @param {Object.} object Plain object * @returns {MyResponse} MyResponse */ - MyResponse.fromObject = (function() { return function fromObject(object) { + MyResponse.fromObject = function fromObject(object) { var message = new $root.MyResponse(); if (object.status !== undefined && object.status !== null) { message.status = object.status | 0; } return message; - };})(); + }; /** * Creates a MyResponse message from a plain object. Also converts values to their respective internal types. @@ -423,7 +417,7 @@ $root.MyResponse = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MyResponse.toObject = (function() { return function toObject(message, options) { + MyResponse.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -441,14 +435,14 @@ $root.MyResponse = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this MyResponse message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + MyResponse.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -456,7 +450,7 @@ $root.MyResponse = (function() { * Converts this MyResponse to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + MyResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; diff --git a/tests/data/test.d.ts b/tests/data/test.d.ts index 3a122640a..c46f1eedc 100644 --- a/tests/data/test.d.ts +++ b/tests/data/test.d.ts @@ -12,9 +12,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Empty; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.Empty; static verify(message: (jspb.test.Empty|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.Empty; static from(object: { [k: string]: any }): jspb.test.Empty; - static toObject: any; + static toObject(message: jspb.test.Empty, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -33,7 +33,7 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.EnumContainer; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.EnumContainer; static verify(message: (jspb.test.EnumContainer|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.EnumContainer; static from(object: { [k: string]: any }): jspb.test.EnumContainer; static toObject: any; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; @@ -51,9 +51,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Simple1; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.Simple1; static verify(message: (jspb.test.Simple1|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.Simple1; static from(object: { [k: string]: any }): jspb.test.Simple1; - static toObject: any; + static toObject(message: jspb.test.Simple1, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -68,9 +68,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Simple2; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.Simple2; static verify(message: (jspb.test.Simple2|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.Simple2; static from(object: { [k: string]: any }): jspb.test.Simple2; - static toObject: any; + static toObject(message: jspb.test.Simple2, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -87,9 +87,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.SpecialCases; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.SpecialCases; static verify(message: (jspb.test.SpecialCases|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.SpecialCases; static from(object: { [k: string]: any }): jspb.test.SpecialCases; - static toObject: any; + static toObject(message: jspb.test.SpecialCases, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -125,9 +125,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.OptionalFields.Nested; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.OptionalFields.Nested; static verify(message: (jspb.test.OptionalFields.Nested|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.OptionalFields.Nested; static from(object: { [k: string]: any }): jspb.test.OptionalFields.Nested; - static toObject: any; + static toObject(message: jspb.test.OptionalFields.Nested, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -182,9 +182,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Complex.Nested; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.Complex.Nested; static verify(message: (jspb.test.Complex.Nested|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.Complex.Nested; static from(object: { [k: string]: any }): jspb.test.Complex.Nested; - static toObject: any; + static toObject(message: jspb.test.Complex.Nested, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -198,9 +198,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.OuterMessage; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.OuterMessage; static verify(message: (jspb.test.OuterMessage|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.OuterMessage; static from(object: { [k: string]: any }): jspb.test.OuterMessage; - static toObject: any; + static toObject(message: jspb.test.OuterMessage, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -216,9 +216,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.OuterMessage.Complex; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.OuterMessage.Complex; static verify(message: (jspb.test.OuterMessage.Complex|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.OuterMessage.Complex; static from(object: { [k: string]: any }): jspb.test.OuterMessage.Complex; - static toObject: any; + static toObject(message: jspb.test.OuterMessage.Complex, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -233,9 +233,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.IsExtension; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.IsExtension; static verify(message: (jspb.test.IsExtension|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.IsExtension; static from(object: { [k: string]: any }): jspb.test.IsExtension; - static toObject: any; + static toObject(message: jspb.test.IsExtension, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -248,9 +248,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.IndirectExtension; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.IndirectExtension; static verify(message: (jspb.test.IndirectExtension|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.IndirectExtension; static from(object: { [k: string]: any }): jspb.test.IndirectExtension; - static toObject: any; + static toObject(message: jspb.test.IndirectExtension, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -300,9 +300,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.FloatingPointFields; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.FloatingPointFields; static verify(message: (jspb.test.FloatingPointFields|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.FloatingPointFields; static from(object: { [k: string]: any }): jspb.test.FloatingPointFields; - static toObject: any; + static toObject(message: jspb.test.FloatingPointFields, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -336,9 +336,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.CloneExtension; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.CloneExtension; static verify(message: (jspb.test.CloneExtension|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.CloneExtension; static from(object: { [k: string]: any }): jspb.test.CloneExtension; - static toObject: any; + static toObject(message: jspb.test.CloneExtension, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -376,9 +376,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestGroup.RepeatedGroup; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.TestGroup.RepeatedGroup; static verify(message: (jspb.test.TestGroup.RepeatedGroup|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.TestGroup.RepeatedGroup; static from(object: { [k: string]: any }): jspb.test.TestGroup.RepeatedGroup; - static toObject: any; + static toObject(message: jspb.test.TestGroup.RepeatedGroup, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -392,9 +392,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestGroup.RequiredGroup; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.TestGroup.RequiredGroup; static verify(message: (jspb.test.TestGroup.RequiredGroup|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.TestGroup.RequiredGroup; static from(object: { [k: string]: any }): jspb.test.TestGroup.RequiredGroup; - static toObject: any; + static toObject(message: jspb.test.TestGroup.RequiredGroup, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -408,9 +408,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestGroup.OptionalGroup; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.TestGroup.OptionalGroup; static verify(message: (jspb.test.TestGroup.OptionalGroup|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.TestGroup.OptionalGroup; static from(object: { [k: string]: any }): jspb.test.TestGroup.OptionalGroup; - static toObject: any; + static toObject(message: jspb.test.TestGroup.OptionalGroup, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -441,9 +441,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestReservedNames; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.TestReservedNames; static verify(message: (jspb.test.TestReservedNames|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.TestReservedNames; static from(object: { [k: string]: any }): jspb.test.TestReservedNames; - static toObject: any; + static toObject(message: jspb.test.TestReservedNames, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -456,9 +456,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestReservedNamesExtension; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.TestReservedNamesExtension; static verify(message: (jspb.test.TestReservedNamesExtension|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.TestReservedNamesExtension; static from(object: { [k: string]: any }): jspb.test.TestReservedNamesExtension; - static toObject: any; + static toObject(message: jspb.test.TestReservedNamesExtension, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -551,9 +551,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.MapValueMessageNoBinary; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.MapValueMessageNoBinary; static verify(message: (jspb.test.MapValueMessageNoBinary|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.MapValueMessageNoBinary; static from(object: { [k: string]: any }): jspb.test.MapValueMessageNoBinary; - static toObject: any; + static toObject(message: jspb.test.MapValueMessageNoBinary, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -566,9 +566,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Deeply; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.Deeply; static verify(message: (jspb.test.Deeply|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.Deeply; static from(object: { [k: string]: any }): jspb.test.Deeply; - static toObject: any; + static toObject(message: jspb.test.Deeply, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -583,9 +583,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Deeply.Nested; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.Deeply.Nested; static verify(message: (jspb.test.Deeply.Nested|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.Deeply.Nested; static from(object: { [k: string]: any }): jspb.test.Deeply.Nested; - static toObject: any; + static toObject(message: jspb.test.Deeply.Nested, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -601,9 +601,9 @@ export namespace jspb { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Deeply.Nested.Message; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): jspb.test.Deeply.Nested.Message; static verify(message: (jspb.test.Deeply.Nested.Message|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): jspb.test.Deeply.Nested.Message; static from(object: { [k: string]: any }): jspb.test.Deeply.Nested.Message; - static toObject: any; + static toObject(message: jspb.test.Deeply.Nested.Message, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -696,9 +696,9 @@ export namespace google { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; static verify(message: (google.protobuf.DescriptorProto.ExtensionRange|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; static from(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - static toObject: any; + static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -713,9 +713,9 @@ export namespace google { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; static verify(message: (google.protobuf.DescriptorProto.ReservedRange|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; static from(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - static toObject: any; + static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -1093,9 +1093,9 @@ export namespace google { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; static verify(message: (google.protobuf.UninterpretedOption.NamePart|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; static from(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - static toObject: any; + static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -1132,9 +1132,9 @@ export namespace google { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; static verify(message: (google.protobuf.SourceCodeInfo.Location|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; static from(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - static toObject: any; + static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } @@ -1170,9 +1170,9 @@ export namespace google { static decode(readerOrBuffer: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; static decodeDelimited(readerOrBuffer: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; static verify(message: (google.protobuf.GeneratedCodeInfo.Annotation|Object)): string; - static fromObject: any; + static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; static from(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - static toObject: any; + static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.ConversionOptions): { [k: string]: any }; toObject(options?: $protobuf.ConversionOptions): { [k: string]: any }; toJSON(): { [k: string]: any }; } diff --git a/tests/data/test.js b/tests/data/test.js index f93342657..1d0c2243f 100644 --- a/tests/data/test.js +++ b/tests/data/test.js @@ -43,9 +43,6 @@ $root.jspb = (function() { } } - /** @alias jspb.test.Empty.prototype */ - var $prototype = Empty.prototype; - /** * Creates a new Empty instance using the specified properties. * @param {Object} [properties] Properties to set @@ -118,18 +115,18 @@ $root.jspb = (function() { * @param {jspb.test.Empty|Object} message Empty message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ - Empty.verify = (function() { return function verify() { + Empty.verify = function verify() { return null; - };})(); + }; /** * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @param {Object.} object Plain object * @returns {jspb.test.Empty} Empty */ - Empty.fromObject = (function() { return function fromObject() { + Empty.fromObject = function fromObject() { return new $root.jspb.test.Empty(); - };})(); + }; /** * Creates an Empty message from a plain object. Also converts values to their respective internal types. @@ -146,16 +143,16 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Empty.toObject = (function() { return function toObject() { + Empty.toObject = function toObject() { return {}; - };})(); + }; /** * Creates a plain object from this Empty message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Empty.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -163,7 +160,7 @@ $root.jspb = (function() { * Converts this Empty to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Empty.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -202,16 +199,13 @@ $root.jspb = (function() { } } - /** @alias jspb.test.EnumContainer.prototype */ - var $prototype = EnumContainer.prototype; - /** * EnumContainer outerEnum. * @type {number} */ - $prototype.outerEnum = 1; + EnumContainer.prototype.outerEnum = 1; - // Referenced types + // Lazily resolved referenced types var $types = {0:"jspb.test.OuterEnum"}; $lazyTypes.push($types); /** @@ -293,7 +287,7 @@ $root.jspb = (function() { * @param {jspb.test.EnumContainer|Object} message EnumContainer message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ - EnumContainer.verify = (function() { return function verify(message) { + EnumContainer.verify = function verify(message) { if (message.outerEnum !== undefined) { switch (message.outerEnum) { default: @@ -305,14 +299,14 @@ $root.jspb = (function() { } } return null; - };})(); + }; /** * Creates an EnumContainer message from a plain object. Also converts values to their respective internal types. * @param {Object.} object Plain object * @returns {jspb.test.EnumContainer} EnumContainer */ - EnumContainer.fromObject = (function() { return function fromObject(object) { + EnumContainer.fromObject = function fromObject(object) { var message = new $root.jspb.test.EnumContainer(); switch (object.outerEnum) { case "FOO": @@ -326,7 +320,7 @@ $root.jspb = (function() { break; } return message; - };})(); + }; /** * Creates an EnumContainer message from a plain object. Also converts values to their respective internal types. @@ -368,7 +362,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + EnumContainer.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -376,7 +370,7 @@ $root.jspb = (function() { * Converts this EnumContainer to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + EnumContainer.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -399,26 +393,23 @@ $root.jspb = (function() { } } - /** @alias jspb.test.Simple1.prototype */ - var $prototype = Simple1.prototype; - /** * Simple1 aString. * @type {string} */ - $prototype.aString = ""; + Simple1.prototype.aString = ""; /** * Simple1 aRepeatedString. * @type {Array.} */ - $prototype.aRepeatedString = $protobuf.util.emptyArray; + Simple1.prototype.aRepeatedString = $protobuf.util.emptyArray; /** * Simple1 aBoolean. * @type {boolean} */ - $prototype.aBoolean = false; + Simple1.prototype.aBoolean = false; /** * Creates a new Simple1 instance using the specified properties. @@ -543,7 +534,7 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.Simple1} Simple1 */ - Simple1.fromObject = (function() { return function fromObject(object) { + Simple1.fromObject = function fromObject(object) { var message = new $root.jspb.test.Simple1(); if (object.aString !== undefined && object.aString !== null) { message.aString = String(object.aString); @@ -558,7 +549,7 @@ $root.jspb = (function() { message.aBoolean = Boolean(object.aBoolean); } return message; - };})(); + }; /** * Creates a Simple1 message from a plain object. Also converts values to their respective internal types. @@ -575,7 +566,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Simple1.toObject = (function() { return function toObject(message, options) { + Simple1.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -612,14 +603,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this Simple1 message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Simple1.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -627,7 +618,7 @@ $root.jspb = (function() { * Converts this Simple1 to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Simple1.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -650,20 +641,17 @@ $root.jspb = (function() { } } - /** @alias jspb.test.Simple2.prototype */ - var $prototype = Simple2.prototype; - /** * Simple2 aString. * @type {string} */ - $prototype.aString = ""; + Simple2.prototype.aString = ""; /** * Simple2 aRepeatedString. * @type {Array.} */ - $prototype.aRepeatedString = $protobuf.util.emptyArray; + Simple2.prototype.aRepeatedString = $protobuf.util.emptyArray; /** * Creates a new Simple2 instance using the specified properties. @@ -776,7 +764,7 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.Simple2} Simple2 */ - Simple2.fromObject = (function() { return function fromObject(object) { + Simple2.fromObject = function fromObject(object) { var message = new $root.jspb.test.Simple2(); if (object.aString !== undefined && object.aString !== null) { message.aString = String(object.aString); @@ -788,7 +776,7 @@ $root.jspb = (function() { } } return message; - };})(); + }; /** * Creates a Simple2 message from a plain object. Also converts values to their respective internal types. @@ -805,7 +793,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Simple2.toObject = (function() { return function toObject(message, options) { + Simple2.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -835,14 +823,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this Simple2 message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Simple2.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -850,7 +838,7 @@ $root.jspb = (function() { * Converts this Simple2 to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Simple2.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -873,35 +861,32 @@ $root.jspb = (function() { } } - /** @alias jspb.test.SpecialCases.prototype */ - var $prototype = SpecialCases.prototype; - /** * SpecialCases normal. * @type {string} */ - $prototype.normal = ""; + SpecialCases.prototype.normal = ""; /** * SpecialCases default. * @name jspb.test.SpecialCases#default * @type {string} */ - $prototype["default"] = ""; + SpecialCases.prototype["default"] = ""; /** * SpecialCases function. * @name jspb.test.SpecialCases#function * @type {string} */ - $prototype["function"] = ""; + SpecialCases.prototype["function"] = ""; /** * SpecialCases var. * @name jspb.test.SpecialCases#var * @type {string} */ - $prototype["var"] = ""; + SpecialCases.prototype["var"] = ""; /** * Creates a new SpecialCases instance using the specified properties. @@ -1016,7 +1001,7 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.SpecialCases} SpecialCases */ - SpecialCases.fromObject = (function() { return function fromObject(object) { + SpecialCases.fromObject = function fromObject(object) { var message = new $root.jspb.test.SpecialCases(); if (object.normal !== undefined && object.normal !== null) { message.normal = String(object.normal); @@ -1031,7 +1016,7 @@ $root.jspb = (function() { message["var"] = String(object["var"]); } return message; - };})(); + }; /** * Creates a SpecialCases message from a plain object. Also converts values to their respective internal types. @@ -1048,7 +1033,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpecialCases.toObject = (function() { return function toObject(message, options) { + SpecialCases.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -1087,14 +1072,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this SpecialCases message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + SpecialCases.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -1102,7 +1087,7 @@ $root.jspb = (function() { * Converts this SpecialCases to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + SpecialCases.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -1125,40 +1110,37 @@ $root.jspb = (function() { } } - /** @alias jspb.test.OptionalFields.prototype */ - var $prototype = OptionalFields.prototype; - /** * OptionalFields aString. * @type {string} */ - $prototype.aString = ""; + OptionalFields.prototype.aString = ""; /** * OptionalFields aBool. * @type {boolean} */ - $prototype.aBool = false; + OptionalFields.prototype.aBool = false; /** * OptionalFields aNestedMessage. * @type {jspb.test.OptionalFields.Nested} */ - $prototype.aNestedMessage = null; + OptionalFields.prototype.aNestedMessage = null; /** * OptionalFields aRepeatedMessage. * @type {Array.} */ - $prototype.aRepeatedMessage = $protobuf.util.emptyArray; + OptionalFields.prototype.aRepeatedMessage = $protobuf.util.emptyArray; /** * OptionalFields aRepeatedString. * @type {Array.} */ - $prototype.aRepeatedString = $protobuf.util.emptyArray; + OptionalFields.prototype.aRepeatedString = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {2:"jspb.test.OptionalFields.Nested",3:"jspb.test.OptionalFields.Nested"}; $lazyTypes.push($types); /** @@ -1422,7 +1404,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + OptionalFields.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -1430,7 +1412,7 @@ $root.jspb = (function() { * Converts this OptionalFields to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + OptionalFields.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -1450,14 +1432,11 @@ $root.jspb = (function() { } } - /** @alias jspb.test.OptionalFields.Nested.prototype */ - var $prototype = Nested.prototype; - /** * Nested anInt. * @type {number} */ - $prototype.anInt = 0; + Nested.prototype.anInt = 0; /** * Creates a new Nested instance using the specified properties. @@ -1552,13 +1531,13 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.OptionalFields.Nested} Nested */ - Nested.fromObject = (function() { return function fromObject(object) { + Nested.fromObject = function fromObject(object) { var message = new $root.jspb.test.OptionalFields.Nested(); if (object.anInt !== undefined && object.anInt !== null) { message.anInt = object.anInt | 0; } return message; - };})(); + }; /** * Creates a Nested message from a plain object. Also converts values to their respective internal types. @@ -1575,7 +1554,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Nested.toObject = (function() { return function toObject(message, options) { + Nested.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -1593,14 +1572,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this Nested message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Nested.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -1608,7 +1587,7 @@ $root.jspb = (function() { * Converts this Nested to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Nested.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -1634,70 +1613,67 @@ $root.jspb = (function() { } } - /** @alias jspb.test.HasExtensions.prototype */ - var $prototype = HasExtensions.prototype; - /** * HasExtensions str1. * @type {string} */ - $prototype.str1 = ""; + HasExtensions.prototype.str1 = ""; /** * HasExtensions str2. * @type {string} */ - $prototype.str2 = ""; + HasExtensions.prototype.str2 = ""; /** * HasExtensions str3. * @type {string} */ - $prototype.str3 = ""; + HasExtensions.prototype.str3 = ""; /** * HasExtensions .jspb.test.IsExtension.extField. * @name jspb.test.HasExtensions#.jspb.test.IsExtension.extField * @type {jspb.test.IsExtension} */ - $prototype[".jspb.test.IsExtension.extField"] = null; + HasExtensions.prototype[".jspb.test.IsExtension.extField"] = null; /** * HasExtensions .jspb.test.IndirectExtension.simple. * @name jspb.test.HasExtensions#.jspb.test.IndirectExtension.simple * @type {jspb.test.Simple1} */ - $prototype[".jspb.test.IndirectExtension.simple"] = null; + HasExtensions.prototype[".jspb.test.IndirectExtension.simple"] = null; /** * HasExtensions .jspb.test.IndirectExtension.str. * @name jspb.test.HasExtensions#.jspb.test.IndirectExtension.str * @type {string} */ - $prototype[".jspb.test.IndirectExtension.str"] = ""; + HasExtensions.prototype[".jspb.test.IndirectExtension.str"] = ""; /** * HasExtensions .jspb.test.IndirectExtension.repeatedStr. * @name jspb.test.HasExtensions#.jspb.test.IndirectExtension.repeatedStr * @type {Array.} */ - $prototype[".jspb.test.IndirectExtension.repeatedStr"] = $protobuf.util.emptyArray; + HasExtensions.prototype[".jspb.test.IndirectExtension.repeatedStr"] = $protobuf.util.emptyArray; /** * HasExtensions .jspb.test.IndirectExtension.repeatedSimple. * @name jspb.test.HasExtensions#.jspb.test.IndirectExtension.repeatedSimple * @type {Array.} */ - $prototype[".jspb.test.IndirectExtension.repeatedSimple"] = $protobuf.util.emptyArray; + HasExtensions.prototype[".jspb.test.IndirectExtension.repeatedSimple"] = $protobuf.util.emptyArray; /** * HasExtensions .jspb.test.simple1. * @name jspb.test.HasExtensions#.jspb.test.simple1 * @type {jspb.test.Simple1} */ - $prototype[".jspb.test.simple1"] = null; + HasExtensions.prototype[".jspb.test.simple1"] = null; - // Referenced types + // Lazily resolved referenced types var $types = {3:"jspb.test.IsExtension",4:"jspb.test.Simple1",7:"jspb.test.Simple1",8:"jspb.test.Simple1"}; $lazyTypes.push($types); /** @@ -2055,7 +2031,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + HasExtensions.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -2063,7 +2039,7 @@ $root.jspb = (function() { * Converts this HasExtensions to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + HasExtensions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -2086,40 +2062,37 @@ $root.jspb = (function() { } } - /** @alias jspb.test.Complex.prototype */ - var $prototype = Complex.prototype; - /** * Complex aString. * @type {string} */ - $prototype.aString = ""; + Complex.prototype.aString = ""; /** * Complex anOutOfOrderBool. * @type {boolean} */ - $prototype.anOutOfOrderBool = false; + Complex.prototype.anOutOfOrderBool = false; /** * Complex aNestedMessage. * @type {jspb.test.Complex.Nested} */ - $prototype.aNestedMessage = null; + Complex.prototype.aNestedMessage = null; /** * Complex aRepeatedMessage. * @type {Array.} */ - $prototype.aRepeatedMessage = $protobuf.util.emptyArray; + Complex.prototype.aRepeatedMessage = $protobuf.util.emptyArray; /** * Complex aRepeatedString. * @type {Array.} */ - $prototype.aRepeatedString = $protobuf.util.emptyArray; + Complex.prototype.aRepeatedString = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {2:"jspb.test.Complex.Nested",3:"jspb.test.Complex.Nested"}; $lazyTypes.push($types); /** @@ -2379,7 +2352,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Complex.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -2387,7 +2360,7 @@ $root.jspb = (function() { * Converts this Complex to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Complex.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -2407,14 +2380,11 @@ $root.jspb = (function() { } } - /** @alias jspb.test.Complex.Nested.prototype */ - var $prototype = Nested.prototype; - /** * Nested anInt. * @type {number} */ - $prototype.anInt = 0; + Nested.prototype.anInt = 0; /** * Creates a new Nested instance using the specified properties. @@ -2505,13 +2475,13 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.Complex.Nested} Nested */ - Nested.fromObject = (function() { return function fromObject(object) { + Nested.fromObject = function fromObject(object) { var message = new $root.jspb.test.Complex.Nested(); if (object.anInt !== undefined && object.anInt !== null) { message.anInt = object.anInt | 0; } return message; - };})(); + }; /** * Creates a Nested message from a plain object. Also converts values to their respective internal types. @@ -2528,7 +2498,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Nested.toObject = (function() { return function toObject(message, options) { + Nested.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -2546,14 +2516,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this Nested message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Nested.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -2561,7 +2531,7 @@ $root.jspb = (function() { * Converts this Nested to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Nested.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -2587,9 +2557,6 @@ $root.jspb = (function() { } } - /** @alias jspb.test.OuterMessage.prototype */ - var $prototype = OuterMessage.prototype; - /** * Creates a new OuterMessage instance using the specified properties. * @param {Object} [properties] Properties to set @@ -2662,18 +2629,18 @@ $root.jspb = (function() { * @param {jspb.test.OuterMessage|Object} message OuterMessage message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ - OuterMessage.verify = (function() { return function verify() { + OuterMessage.verify = function verify() { return null; - };})(); + }; /** * Creates an OuterMessage message from a plain object. Also converts values to their respective internal types. * @param {Object.} object Plain object * @returns {jspb.test.OuterMessage} OuterMessage */ - OuterMessage.fromObject = (function() { return function fromObject() { + OuterMessage.fromObject = function fromObject() { return new $root.jspb.test.OuterMessage(); - };})(); + }; /** * Creates an OuterMessage message from a plain object. Also converts values to their respective internal types. @@ -2690,16 +2657,16 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OuterMessage.toObject = (function() { return function toObject() { + OuterMessage.toObject = function toObject() { return {}; - };})(); + }; /** * Creates a plain object from this OuterMessage message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + OuterMessage.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -2707,7 +2674,7 @@ $root.jspb = (function() { * Converts this OuterMessage to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + OuterMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -2727,14 +2694,11 @@ $root.jspb = (function() { } } - /** @alias jspb.test.OuterMessage.Complex.prototype */ - var $prototype = Complex.prototype; - /** * Complex innerComplexField. * @type {number} */ - $prototype.innerComplexField = 0; + Complex.prototype.innerComplexField = 0; /** * Creates a new Complex instance using the specified properties. @@ -2829,13 +2793,13 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.OuterMessage.Complex} Complex */ - Complex.fromObject = (function() { return function fromObject(object) { + Complex.fromObject = function fromObject(object) { var message = new $root.jspb.test.OuterMessage.Complex(); if (object.innerComplexField !== undefined && object.innerComplexField !== null) { message.innerComplexField = object.innerComplexField | 0; } return message; - };})(); + }; /** * Creates a Complex message from a plain object. Also converts values to their respective internal types. @@ -2852,7 +2816,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Complex.toObject = (function() { return function toObject(message, options) { + Complex.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -2870,14 +2834,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this Complex message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Complex.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -2885,7 +2849,7 @@ $root.jspb = (function() { * Converts this Complex to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Complex.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -2911,14 +2875,11 @@ $root.jspb = (function() { } } - /** @alias jspb.test.IsExtension.prototype */ - var $prototype = IsExtension.prototype; - /** * IsExtension ext1. * @type {string} */ - $prototype.ext1 = ""; + IsExtension.prototype.ext1 = ""; /** * Creates a new IsExtension instance using the specified properties. @@ -3013,13 +2974,13 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.IsExtension} IsExtension */ - IsExtension.fromObject = (function() { return function fromObject(object) { + IsExtension.fromObject = function fromObject(object) { var message = new $root.jspb.test.IsExtension(); if (object.ext1 !== undefined && object.ext1 !== null) { message.ext1 = String(object.ext1); } return message; - };})(); + }; /** * Creates an IsExtension message from a plain object. Also converts values to their respective internal types. @@ -3036,7 +2997,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IsExtension.toObject = (function() { return function toObject(message, options) { + IsExtension.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -3054,14 +3015,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this IsExtension message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + IsExtension.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -3069,7 +3030,7 @@ $root.jspb = (function() { * Converts this IsExtension to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + IsExtension.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -3092,9 +3053,6 @@ $root.jspb = (function() { } } - /** @alias jspb.test.IndirectExtension.prototype */ - var $prototype = IndirectExtension.prototype; - /** * Creates a new IndirectExtension instance using the specified properties. * @param {Object} [properties] Properties to set @@ -3167,18 +3125,18 @@ $root.jspb = (function() { * @param {jspb.test.IndirectExtension|Object} message IndirectExtension message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ - IndirectExtension.verify = (function() { return function verify() { + IndirectExtension.verify = function verify() { return null; - };})(); + }; /** * Creates an IndirectExtension message from a plain object. Also converts values to their respective internal types. * @param {Object.} object Plain object * @returns {jspb.test.IndirectExtension} IndirectExtension */ - IndirectExtension.fromObject = (function() { return function fromObject() { + IndirectExtension.fromObject = function fromObject() { return new $root.jspb.test.IndirectExtension(); - };})(); + }; /** * Creates an IndirectExtension message from a plain object. Also converts values to their respective internal types. @@ -3195,16 +3153,16 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IndirectExtension.toObject = (function() { return function toObject() { + IndirectExtension.toObject = function toObject() { return {}; - };})(); + }; /** * Creates a plain object from this IndirectExtension message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + IndirectExtension.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -3212,7 +3170,7 @@ $root.jspb = (function() { * Converts this IndirectExtension to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + IndirectExtension.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -3235,46 +3193,43 @@ $root.jspb = (function() { } } - /** @alias jspb.test.DefaultValues.prototype */ - var $prototype = DefaultValues.prototype; - /** * DefaultValues stringField. * @type {string} */ - $prototype.stringField = "default<>'\"abc"; + DefaultValues.prototype.stringField = "default<>'\"abc"; /** * DefaultValues boolField. * @type {boolean} */ - $prototype.boolField = true; + DefaultValues.prototype.boolField = true; /** * DefaultValues intField. * @type {number|$protobuf.Long} */ - $prototype.intField = $protobuf.util.Long ? $protobuf.util.Long.fromBits(11,0,false) : 11; + DefaultValues.prototype.intField = $protobuf.util.Long ? $protobuf.util.Long.fromBits(11,0,false) : 11; /** * DefaultValues enumField. * @type {number} */ - $prototype.enumField = undefined; + DefaultValues.prototype.enumField = undefined; /** * DefaultValues emptyField. * @type {string} */ - $prototype.emptyField = ""; + DefaultValues.prototype.emptyField = ""; /** * DefaultValues bytesField. * @type {Uint8Array} */ - $prototype.bytesField = $protobuf.util.newBuffer([109,111,111]); + DefaultValues.prototype.bytesField = $protobuf.util.newBuffer([109,111,111]); - // Referenced types + // Lazily resolved referenced types var $types = {3:"jspb.test.DefaultValues.Enum"}; $lazyTypes.push($types); /** @@ -3570,7 +3525,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + DefaultValues.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -3578,7 +3533,7 @@ $root.jspb = (function() { * Converts this DefaultValues to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + DefaultValues.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -3617,56 +3572,53 @@ $root.jspb = (function() { } } - /** @alias jspb.test.FloatingPointFields.prototype */ - var $prototype = FloatingPointFields.prototype; - /** * FloatingPointFields optionalFloatField. * @type {number} */ - $prototype.optionalFloatField = 0; + FloatingPointFields.prototype.optionalFloatField = 0; /** * FloatingPointFields requiredFloatField. * @type {number} */ - $prototype.requiredFloatField = 0; + FloatingPointFields.prototype.requiredFloatField = 0; /** * FloatingPointFields repeatedFloatField. * @type {Array.} */ - $prototype.repeatedFloatField = $protobuf.util.emptyArray; + FloatingPointFields.prototype.repeatedFloatField = $protobuf.util.emptyArray; /** * FloatingPointFields defaultFloatField. * @type {number} */ - $prototype.defaultFloatField = 2; + FloatingPointFields.prototype.defaultFloatField = 2; /** * FloatingPointFields optionalDoubleField. * @type {number} */ - $prototype.optionalDoubleField = 0; + FloatingPointFields.prototype.optionalDoubleField = 0; /** * FloatingPointFields requiredDoubleField. * @type {number} */ - $prototype.requiredDoubleField = 0; + FloatingPointFields.prototype.requiredDoubleField = 0; /** * FloatingPointFields repeatedDoubleField. * @type {Array.} */ - $prototype.repeatedDoubleField = $protobuf.util.emptyArray; + FloatingPointFields.prototype.repeatedDoubleField = $protobuf.util.emptyArray; /** * FloatingPointFields defaultDoubleField. * @type {number} */ - $prototype.defaultDoubleField = 2; + FloatingPointFields.prototype.defaultDoubleField = 2; /** * Creates a new FloatingPointFields instance using the specified properties. @@ -3816,7 +3768,7 @@ $root.jspb = (function() { * @param {jspb.test.FloatingPointFields|Object} message FloatingPointFields message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ - FloatingPointFields.verify = (function() { return function verify(message) { + FloatingPointFields.verify = function verify(message) { if (message.optionalFloatField !== undefined) { if (typeof message.optionalFloatField !== "number") { return "optionalFloatField: number expected"; @@ -3864,14 +3816,14 @@ $root.jspb = (function() { } } return null; - };})(); + }; /** * Creates a FloatingPointFields message from a plain object. Also converts values to their respective internal types. * @param {Object.} object Plain object * @returns {jspb.test.FloatingPointFields} FloatingPointFields */ - FloatingPointFields.fromObject = (function() { return function fromObject(object) { + FloatingPointFields.fromObject = function fromObject(object) { var message = new $root.jspb.test.FloatingPointFields(); if (object.optionalFloatField !== undefined && object.optionalFloatField !== null) { message.optionalFloatField = Number(object.optionalFloatField); @@ -3904,7 +3856,7 @@ $root.jspb = (function() { message.defaultDoubleField = Number(object.defaultDoubleField); } return message; - };})(); + }; /** * Creates a FloatingPointFields message from a plain object. Also converts values to their respective internal types. @@ -3921,7 +3873,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FloatingPointFields.toObject = (function() { return function toObject(message, options) { + FloatingPointFields.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -3996,14 +3948,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this FloatingPointFields message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + FloatingPointFields.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -4011,7 +3963,7 @@ $root.jspb = (function() { * Converts this FloatingPointFields to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + FloatingPointFields.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -4034,47 +3986,44 @@ $root.jspb = (function() { } } - /** @alias jspb.test.TestClone.prototype */ - var $prototype = TestClone.prototype; - /** * TestClone str. * @type {string} */ - $prototype.str = ""; + TestClone.prototype.str = ""; /** * TestClone simple1. * @type {jspb.test.Simple1} */ - $prototype.simple1 = null; + TestClone.prototype.simple1 = null; /** * TestClone simple2. * @type {Array.} */ - $prototype.simple2 = $protobuf.util.emptyArray; + TestClone.prototype.simple2 = $protobuf.util.emptyArray; /** * TestClone bytesField. * @type {Uint8Array} */ - $prototype.bytesField = $protobuf.util.newBuffer([]); + TestClone.prototype.bytesField = $protobuf.util.newBuffer([]); /** * TestClone unused. * @type {string} */ - $prototype.unused = ""; + TestClone.prototype.unused = ""; /** * TestClone .jspb.test.CloneExtension.extField. * @name jspb.test.TestClone#.jspb.test.CloneExtension.extField * @type {jspb.test.CloneExtension} */ - $prototype[".jspb.test.CloneExtension.extField"] = null; + TestClone.prototype[".jspb.test.CloneExtension.extField"] = null; - // Referenced types + // Lazily resolved referenced types var $types = {1:"jspb.test.Simple1",2:"jspb.test.Simple1",5:"jspb.test.CloneExtension"}; $lazyTypes.push($types); /** @@ -4355,7 +4304,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + TestClone.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -4363,7 +4312,7 @@ $root.jspb = (function() { * Converts this TestClone to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + TestClone.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -4386,14 +4335,11 @@ $root.jspb = (function() { } } - /** @alias jspb.test.CloneExtension.prototype */ - var $prototype = CloneExtension.prototype; - /** * CloneExtension ext. * @type {string} */ - $prototype.ext = ""; + CloneExtension.prototype.ext = ""; /** * Creates a new CloneExtension instance using the specified properties. @@ -4488,13 +4434,13 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.CloneExtension} CloneExtension */ - CloneExtension.fromObject = (function() { return function fromObject(object) { + CloneExtension.fromObject = function fromObject(object) { var message = new $root.jspb.test.CloneExtension(); if (object.ext !== undefined && object.ext !== null) { message.ext = String(object.ext); } return message; - };})(); + }; /** * Creates a CloneExtension message from a plain object. Also converts values to their respective internal types. @@ -4511,7 +4457,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloneExtension.toObject = (function() { return function toObject(message, options) { + CloneExtension.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -4529,14 +4475,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this CloneExtension message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + CloneExtension.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -4544,7 +4490,7 @@ $root.jspb = (function() { * Converts this CloneExtension to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + CloneExtension.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -4567,46 +4513,43 @@ $root.jspb = (function() { } } - /** @alias jspb.test.TestGroup.prototype */ - var $prototype = TestGroup.prototype; - /** * TestGroup repeatedGroup. * @type {Array.} */ - $prototype.repeatedGroup = $protobuf.util.emptyArray; + TestGroup.prototype.repeatedGroup = $protobuf.util.emptyArray; /** * TestGroup requiredGroup. * @type {jspb.test.TestGroup.RequiredGroup} */ - $prototype.requiredGroup = null; + TestGroup.prototype.requiredGroup = null; /** * TestGroup optionalGroup. * @type {jspb.test.TestGroup.OptionalGroup} */ - $prototype.optionalGroup = null; + TestGroup.prototype.optionalGroup = null; /** * TestGroup id. * @type {string} */ - $prototype.id = ""; + TestGroup.prototype.id = ""; /** * TestGroup requiredSimple. * @type {jspb.test.Simple2} */ - $prototype.requiredSimple = null; + TestGroup.prototype.requiredSimple = null; /** * TestGroup optionalSimple. * @type {jspb.test.Simple2} */ - $prototype.optionalSimple = null; + TestGroup.prototype.optionalSimple = null; - // Referenced types + // Lazily resolved referenced types var $types = {0:"jspb.test.TestGroup.RepeatedGroup",1:"jspb.test.TestGroup.RequiredGroup",2:"jspb.test.TestGroup.OptionalGroup",4:"jspb.test.Simple2",5:"jspb.test.Simple2"}; $lazyTypes.push($types); /** @@ -4875,7 +4818,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + TestGroup.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -4883,7 +4826,7 @@ $root.jspb = (function() { * Converts this TestGroup to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + TestGroup.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -4903,20 +4846,17 @@ $root.jspb = (function() { } } - /** @alias jspb.test.TestGroup.RepeatedGroup.prototype */ - var $prototype = RepeatedGroup.prototype; - /** * RepeatedGroup id. * @type {string} */ - $prototype.id = ""; + RepeatedGroup.prototype.id = ""; /** * RepeatedGroup someBool. * @type {Array.} */ - $prototype.someBool = $protobuf.util.emptyArray; + RepeatedGroup.prototype.someBool = $protobuf.util.emptyArray; /** * Creates a new RepeatedGroup instance using the specified properties. @@ -5039,7 +4979,7 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.TestGroup.RepeatedGroup} RepeatedGroup */ - RepeatedGroup.fromObject = (function() { return function fromObject(object) { + RepeatedGroup.fromObject = function fromObject(object) { var message = new $root.jspb.test.TestGroup.RepeatedGroup(); if (object.id !== undefined && object.id !== null) { message.id = String(object.id); @@ -5051,7 +4991,7 @@ $root.jspb = (function() { } } return message; - };})(); + }; /** * Creates a RepeatedGroup message from a plain object. Also converts values to their respective internal types. @@ -5068,7 +5008,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RepeatedGroup.toObject = (function() { return function toObject(message, options) { + RepeatedGroup.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -5098,14 +5038,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this RepeatedGroup message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + RepeatedGroup.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -5113,7 +5053,7 @@ $root.jspb = (function() { * Converts this RepeatedGroup to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + RepeatedGroup.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -5136,14 +5076,11 @@ $root.jspb = (function() { } } - /** @alias jspb.test.TestGroup.RequiredGroup.prototype */ - var $prototype = RequiredGroup.prototype; - /** * RequiredGroup id. * @type {string} */ - $prototype.id = ""; + RequiredGroup.prototype.id = ""; /** * Creates a new RequiredGroup instance using the specified properties. @@ -5237,13 +5174,13 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.TestGroup.RequiredGroup} RequiredGroup */ - RequiredGroup.fromObject = (function() { return function fromObject(object) { + RequiredGroup.fromObject = function fromObject(object) { var message = new $root.jspb.test.TestGroup.RequiredGroup(); if (object.id !== undefined && object.id !== null) { message.id = String(object.id); } return message; - };})(); + }; /** * Creates a RequiredGroup message from a plain object. Also converts values to their respective internal types. @@ -5260,7 +5197,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RequiredGroup.toObject = (function() { return function toObject(message, options) { + RequiredGroup.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -5278,14 +5215,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this RequiredGroup message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + RequiredGroup.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -5293,7 +5230,7 @@ $root.jspb = (function() { * Converts this RequiredGroup to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + RequiredGroup.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -5316,14 +5253,11 @@ $root.jspb = (function() { } } - /** @alias jspb.test.TestGroup.OptionalGroup.prototype */ - var $prototype = OptionalGroup.prototype; - /** * OptionalGroup id. * @type {string} */ - $prototype.id = ""; + OptionalGroup.prototype.id = ""; /** * Creates a new OptionalGroup instance using the specified properties. @@ -5417,13 +5351,13 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.TestGroup.OptionalGroup} OptionalGroup */ - OptionalGroup.fromObject = (function() { return function fromObject(object) { + OptionalGroup.fromObject = function fromObject(object) { var message = new $root.jspb.test.TestGroup.OptionalGroup(); if (object.id !== undefined && object.id !== null) { message.id = String(object.id); } return message; - };})(); + }; /** * Creates an OptionalGroup message from a plain object. Also converts values to their respective internal types. @@ -5440,7 +5374,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OptionalGroup.toObject = (function() { return function toObject(message, options) { + OptionalGroup.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -5458,14 +5392,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this OptionalGroup message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + OptionalGroup.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -5473,7 +5407,7 @@ $root.jspb = (function() { * Converts this OptionalGroup to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + OptionalGroup.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -5499,16 +5433,13 @@ $root.jspb = (function() { } } - /** @alias jspb.test.TestGroup1.prototype */ - var $prototype = TestGroup1.prototype; - /** * TestGroup1 group. * @type {jspb.test.TestGroup.RepeatedGroup} */ - $prototype.group = null; + TestGroup1.prototype.group = null; - // Referenced types + // Lazily resolved referenced types var $types = {0:"jspb.test.TestGroup.RepeatedGroup"}; $lazyTypes.push($types); /** @@ -5653,7 +5584,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + TestGroup1.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -5661,7 +5592,7 @@ $root.jspb = (function() { * Converts this TestGroup1 to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + TestGroup1.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -5684,21 +5615,18 @@ $root.jspb = (function() { } } - /** @alias jspb.test.TestReservedNames.prototype */ - var $prototype = TestReservedNames.prototype; - /** * TestReservedNames extension. * @type {number} */ - $prototype.extension = 0; + TestReservedNames.prototype.extension = 0; /** * TestReservedNames .jspb.test.TestReservedNamesExtension.foo. * @name jspb.test.TestReservedNames#.jspb.test.TestReservedNamesExtension.foo * @type {number} */ - $prototype[".jspb.test.TestReservedNamesExtension.foo"] = 0; + TestReservedNames.prototype[".jspb.test.TestReservedNamesExtension.foo"] = 0; /** * Creates a new TestReservedNames instance using the specified properties. @@ -5805,7 +5733,7 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.TestReservedNames} TestReservedNames */ - TestReservedNames.fromObject = (function() { return function fromObject(object) { + TestReservedNames.fromObject = function fromObject(object) { var message = new $root.jspb.test.TestReservedNames(); if (object.extension !== undefined && object.extension !== null) { message.extension = object.extension | 0; @@ -5814,7 +5742,7 @@ $root.jspb = (function() { message[".jspb.test.TestReservedNamesExtension.foo"] = object[".jspb.test.TestReservedNamesExtension.foo"] | 0; } return message; - };})(); + }; /** * Creates a TestReservedNames message from a plain object. Also converts values to their respective internal types. @@ -5831,7 +5759,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TestReservedNames.toObject = (function() { return function toObject(message, options) { + TestReservedNames.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -5856,14 +5784,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this TestReservedNames message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + TestReservedNames.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -5871,7 +5799,7 @@ $root.jspb = (function() { * Converts this TestReservedNames to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + TestReservedNames.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -5894,9 +5822,6 @@ $root.jspb = (function() { } } - /** @alias jspb.test.TestReservedNamesExtension.prototype */ - var $prototype = TestReservedNamesExtension.prototype; - /** * Creates a new TestReservedNamesExtension instance using the specified properties. * @param {Object} [properties] Properties to set @@ -5969,18 +5894,18 @@ $root.jspb = (function() { * @param {jspb.test.TestReservedNamesExtension|Object} message TestReservedNamesExtension message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ - TestReservedNamesExtension.verify = (function() { return function verify() { + TestReservedNamesExtension.verify = function verify() { return null; - };})(); + }; /** * Creates a TestReservedNamesExtension message from a plain object. Also converts values to their respective internal types. * @param {Object.} object Plain object * @returns {jspb.test.TestReservedNamesExtension} TestReservedNamesExtension */ - TestReservedNamesExtension.fromObject = (function() { return function fromObject() { + TestReservedNamesExtension.fromObject = function fromObject() { return new $root.jspb.test.TestReservedNamesExtension(); - };})(); + }; /** * Creates a TestReservedNamesExtension message from a plain object. Also converts values to their respective internal types. @@ -5997,16 +5922,16 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TestReservedNamesExtension.toObject = (function() { return function toObject() { + TestReservedNamesExtension.toObject = function toObject() { return {}; - };})(); + }; /** * Creates a plain object from this TestReservedNamesExtension message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + TestReservedNamesExtension.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -6014,7 +5939,7 @@ $root.jspb = (function() { * Converts this TestReservedNamesExtension to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + TestReservedNamesExtension.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -6037,68 +5962,65 @@ $root.jspb = (function() { } } - /** @alias jspb.test.TestMessageWithOneof.prototype */ - var $prototype = TestMessageWithOneof.prototype; - /** * TestMessageWithOneof pone. * @type {string} */ - $prototype.pone = ""; + TestMessageWithOneof.prototype.pone = ""; /** * TestMessageWithOneof pthree. * @type {string} */ - $prototype.pthree = ""; + TestMessageWithOneof.prototype.pthree = ""; /** * TestMessageWithOneof rone. * @type {jspb.test.TestMessageWithOneof} */ - $prototype.rone = null; + TestMessageWithOneof.prototype.rone = null; /** * TestMessageWithOneof rtwo. * @type {string} */ - $prototype.rtwo = ""; + TestMessageWithOneof.prototype.rtwo = ""; /** * TestMessageWithOneof normalField. * @type {boolean} */ - $prototype.normalField = false; + TestMessageWithOneof.prototype.normalField = false; /** * TestMessageWithOneof repeatedField. * @type {Array.} */ - $prototype.repeatedField = $protobuf.util.emptyArray; + TestMessageWithOneof.prototype.repeatedField = $protobuf.util.emptyArray; /** * TestMessageWithOneof aone. * @type {number} */ - $prototype.aone = 1234; + TestMessageWithOneof.prototype.aone = 1234; /** * TestMessageWithOneof atwo. * @type {number} */ - $prototype.atwo = 0; + TestMessageWithOneof.prototype.atwo = 0; /** * TestMessageWithOneof bone. * @type {number} */ - $prototype.bone = 0; + TestMessageWithOneof.prototype.bone = 0; /** * TestMessageWithOneof btwo. * @type {number} */ - $prototype.btwo = 1234; + TestMessageWithOneof.prototype.btwo = 1234; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -6108,7 +6030,7 @@ $root.jspb = (function() { * @name jspb.test.TestMessageWithOneof#partialOneof * @type {string|undefined} */ - Object.defineProperty($prototype, "partialOneof", { + Object.defineProperty(TestMessageWithOneof.prototype, "partialOneof", { get: $protobuf.util.oneOfGetter($oneOfFields = ["pone", "pthree"]), set: $protobuf.util.oneOfSetter($oneOfFields) }); @@ -6118,7 +6040,7 @@ $root.jspb = (function() { * @name jspb.test.TestMessageWithOneof#recursiveOneof * @type {string|undefined} */ - Object.defineProperty($prototype, "recursiveOneof", { + Object.defineProperty(TestMessageWithOneof.prototype, "recursiveOneof", { get: $protobuf.util.oneOfGetter($oneOfFields = ["rone", "rtwo"]), set: $protobuf.util.oneOfSetter($oneOfFields) }); @@ -6128,7 +6050,7 @@ $root.jspb = (function() { * @name jspb.test.TestMessageWithOneof#defaultOneofA * @type {string|undefined} */ - Object.defineProperty($prototype, "defaultOneofA", { + Object.defineProperty(TestMessageWithOneof.prototype, "defaultOneofA", { get: $protobuf.util.oneOfGetter($oneOfFields = ["aone", "atwo"]), set: $protobuf.util.oneOfSetter($oneOfFields) }); @@ -6138,12 +6060,12 @@ $root.jspb = (function() { * @name jspb.test.TestMessageWithOneof#defaultOneofB * @type {string|undefined} */ - Object.defineProperty($prototype, "defaultOneofB", { + Object.defineProperty(TestMessageWithOneof.prototype, "defaultOneofB", { get: $protobuf.util.oneOfGetter($oneOfFields = ["bone", "btwo"]), set: $protobuf.util.oneOfSetter($oneOfFields) }); - // Referenced types + // Lazily resolved referenced types var $types = {2:"jspb.test.TestMessageWithOneof"}; $lazyTypes.push($types); /** @@ -6516,7 +6438,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + TestMessageWithOneof.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -6524,7 +6446,7 @@ $root.jspb = (function() { * Converts this TestMessageWithOneof to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + TestMessageWithOneof.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -6547,20 +6469,17 @@ $root.jspb = (function() { } } - /** @alias jspb.test.TestEndsWithBytes.prototype */ - var $prototype = TestEndsWithBytes.prototype; - /** * TestEndsWithBytes value. * @type {number} */ - $prototype.value = 0; + TestEndsWithBytes.prototype.value = 0; /** * TestEndsWithBytes data. * @type {Uint8Array} */ - $prototype.data = $protobuf.util.newBuffer([]); + TestEndsWithBytes.prototype.data = $protobuf.util.newBuffer([]); /** * Creates a new TestEndsWithBytes instance using the specified properties. @@ -6731,7 +6650,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + TestEndsWithBytes.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -6739,7 +6658,7 @@ $root.jspb = (function() { * Converts this TestEndsWithBytes to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + TestEndsWithBytes.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -6762,82 +6681,79 @@ $root.jspb = (function() { } } - /** @alias jspb.test.TestMapFieldsNoBinary.prototype */ - var $prototype = TestMapFieldsNoBinary.prototype; - /** * TestMapFieldsNoBinary mapStringString. * @type {Object.} */ - $prototype.mapStringString = $protobuf.util.emptyObject; + TestMapFieldsNoBinary.prototype.mapStringString = $protobuf.util.emptyObject; /** * TestMapFieldsNoBinary mapStringInt32. * @type {Object.} */ - $prototype.mapStringInt32 = $protobuf.util.emptyObject; + TestMapFieldsNoBinary.prototype.mapStringInt32 = $protobuf.util.emptyObject; /** * TestMapFieldsNoBinary mapStringInt64. * @type {Object.} */ - $prototype.mapStringInt64 = $protobuf.util.emptyObject; + TestMapFieldsNoBinary.prototype.mapStringInt64 = $protobuf.util.emptyObject; /** * TestMapFieldsNoBinary mapStringBool. * @type {Object.} */ - $prototype.mapStringBool = $protobuf.util.emptyObject; + TestMapFieldsNoBinary.prototype.mapStringBool = $protobuf.util.emptyObject; /** * TestMapFieldsNoBinary mapStringDouble. * @type {Object.} */ - $prototype.mapStringDouble = $protobuf.util.emptyObject; + TestMapFieldsNoBinary.prototype.mapStringDouble = $protobuf.util.emptyObject; /** * TestMapFieldsNoBinary mapStringEnum. * @type {Object.} */ - $prototype.mapStringEnum = $protobuf.util.emptyObject; + TestMapFieldsNoBinary.prototype.mapStringEnum = $protobuf.util.emptyObject; /** * TestMapFieldsNoBinary mapStringMsg. * @type {Object.} */ - $prototype.mapStringMsg = $protobuf.util.emptyObject; + TestMapFieldsNoBinary.prototype.mapStringMsg = $protobuf.util.emptyObject; /** * TestMapFieldsNoBinary mapInt32String. * @type {Object.} */ - $prototype.mapInt32String = $protobuf.util.emptyObject; + TestMapFieldsNoBinary.prototype.mapInt32String = $protobuf.util.emptyObject; /** * TestMapFieldsNoBinary mapInt64String. * @type {Object.} */ - $prototype.mapInt64String = $protobuf.util.emptyObject; + TestMapFieldsNoBinary.prototype.mapInt64String = $protobuf.util.emptyObject; /** * TestMapFieldsNoBinary mapBoolString. * @type {Object.} */ - $prototype.mapBoolString = $protobuf.util.emptyObject; + TestMapFieldsNoBinary.prototype.mapBoolString = $protobuf.util.emptyObject; /** * TestMapFieldsNoBinary testMapFields. * @type {jspb.test.TestMapFieldsNoBinary} */ - $prototype.testMapFields = null; + TestMapFieldsNoBinary.prototype.testMapFields = null; /** * TestMapFieldsNoBinary mapStringTestmapfields. * @type {Object.} */ - $prototype.mapStringTestmapfields = $protobuf.util.emptyObject; + TestMapFieldsNoBinary.prototype.mapStringTestmapfields = $protobuf.util.emptyObject; - // Referenced types + // Lazily resolved referenced types var $types = {5:"jspb.test.MapValueEnumNoBinary",6:"jspb.test.MapValueMessageNoBinary",10:"jspb.test.TestMapFieldsNoBinary",11:"jspb.test.TestMapFieldsNoBinary"}; $lazyTypes.push($types); /** @@ -7498,7 +7414,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + TestMapFieldsNoBinary.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -7506,7 +7422,7 @@ $root.jspb = (function() { * Converts this TestMapFieldsNoBinary to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + TestMapFieldsNoBinary.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -7547,14 +7463,11 @@ $root.jspb = (function() { } } - /** @alias jspb.test.MapValueMessageNoBinary.prototype */ - var $prototype = MapValueMessageNoBinary.prototype; - /** * MapValueMessageNoBinary foo. * @type {number} */ - $prototype.foo = 0; + MapValueMessageNoBinary.prototype.foo = 0; /** * Creates a new MapValueMessageNoBinary instance using the specified properties. @@ -7649,13 +7562,13 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.MapValueMessageNoBinary} MapValueMessageNoBinary */ - MapValueMessageNoBinary.fromObject = (function() { return function fromObject(object) { + MapValueMessageNoBinary.fromObject = function fromObject(object) { var message = new $root.jspb.test.MapValueMessageNoBinary(); if (object.foo !== undefined && object.foo !== null) { message.foo = object.foo | 0; } return message; - };})(); + }; /** * Creates a MapValueMessageNoBinary message from a plain object. Also converts values to their respective internal types. @@ -7672,7 +7585,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MapValueMessageNoBinary.toObject = (function() { return function toObject(message, options) { + MapValueMessageNoBinary.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -7690,14 +7603,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this MapValueMessageNoBinary message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + MapValueMessageNoBinary.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -7705,7 +7618,7 @@ $root.jspb = (function() { * Converts this MapValueMessageNoBinary to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + MapValueMessageNoBinary.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -7728,9 +7641,6 @@ $root.jspb = (function() { } } - /** @alias jspb.test.Deeply.prototype */ - var $prototype = Deeply.prototype; - /** * Creates a new Deeply instance using the specified properties. * @param {Object} [properties] Properties to set @@ -7803,18 +7713,18 @@ $root.jspb = (function() { * @param {jspb.test.Deeply|Object} message Deeply message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ - Deeply.verify = (function() { return function verify() { + Deeply.verify = function verify() { return null; - };})(); + }; /** * Creates a Deeply message from a plain object. Also converts values to their respective internal types. * @param {Object.} object Plain object * @returns {jspb.test.Deeply} Deeply */ - Deeply.fromObject = (function() { return function fromObject() { + Deeply.fromObject = function fromObject() { return new $root.jspb.test.Deeply(); - };})(); + }; /** * Creates a Deeply message from a plain object. Also converts values to their respective internal types. @@ -7831,16 +7741,16 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Deeply.toObject = (function() { return function toObject() { + Deeply.toObject = function toObject() { return {}; - };})(); + }; /** * Creates a plain object from this Deeply message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Deeply.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -7848,7 +7758,7 @@ $root.jspb = (function() { * Converts this Deeply to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Deeply.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -7868,9 +7778,6 @@ $root.jspb = (function() { } } - /** @alias jspb.test.Deeply.Nested.prototype */ - var $prototype = Nested.prototype; - /** * Creates a new Nested instance using the specified properties. * @param {Object} [properties] Properties to set @@ -7943,18 +7850,18 @@ $root.jspb = (function() { * @param {jspb.test.Deeply.Nested|Object} message Nested message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ - Nested.verify = (function() { return function verify() { + Nested.verify = function verify() { return null; - };})(); + }; /** * Creates a Nested message from a plain object. Also converts values to their respective internal types. * @param {Object.} object Plain object * @returns {jspb.test.Deeply.Nested} Nested */ - Nested.fromObject = (function() { return function fromObject() { + Nested.fromObject = function fromObject() { return new $root.jspb.test.Deeply.Nested(); - };})(); + }; /** * Creates a Nested message from a plain object. Also converts values to their respective internal types. @@ -7971,16 +7878,16 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Nested.toObject = (function() { return function toObject() { + Nested.toObject = function toObject() { return {}; - };})(); + }; /** * Creates a plain object from this Nested message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Nested.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -7988,7 +7895,7 @@ $root.jspb = (function() { * Converts this Nested to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Nested.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -8008,14 +7915,11 @@ $root.jspb = (function() { } } - /** @alias jspb.test.Deeply.Nested.Message.prototype */ - var $prototype = Message.prototype; - /** * Message count. * @type {number} */ - $prototype.count = 0; + Message.prototype.count = 0; /** * Creates a new Message instance using the specified properties. @@ -8110,13 +8014,13 @@ $root.jspb = (function() { * @param {Object.} object Plain object * @returns {jspb.test.Deeply.Nested.Message} Message */ - Message.fromObject = (function() { return function fromObject(object) { + Message.fromObject = function fromObject(object) { var message = new $root.jspb.test.Deeply.Nested.Message(); if (object.count !== undefined && object.count !== null) { message.count = object.count | 0; } return message; - };})(); + }; /** * Creates a Message message from a plain object. Also converts values to their respective internal types. @@ -8133,7 +8037,7 @@ $root.jspb = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Message.toObject = (function() { return function toObject(message, options) { + Message.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -8151,14 +8055,14 @@ $root.jspb = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this Message message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Message.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -8166,7 +8070,7 @@ $root.jspb = (function() { * Converts this Message to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Message.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -8219,16 +8123,13 @@ $root.google = (function() { } } - /** @alias google.protobuf.FileDescriptorSet.prototype */ - var $prototype = FileDescriptorSet.prototype; - /** * FileDescriptorSet file. * @type {Array.} */ - $prototype.file = $protobuf.util.emptyArray; + FileDescriptorSet.prototype.file = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {0:"google.protobuf.FileDescriptorProto"}; $lazyTypes.push($types); /** @@ -8389,7 +8290,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + FileDescriptorSet.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -8397,7 +8298,7 @@ $root.google = (function() { * Converts this FileDescriptorSet to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + FileDescriptorSet.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -8420,83 +8321,80 @@ $root.google = (function() { } } - /** @alias google.protobuf.FileDescriptorProto.prototype */ - var $prototype = FileDescriptorProto.prototype; - /** * FileDescriptorProto name. * @type {string} */ - $prototype.name = ""; + FileDescriptorProto.prototype.name = ""; /** * FileDescriptorProto package. * @name google.protobuf.FileDescriptorProto#package * @type {string} */ - $prototype["package"] = ""; + FileDescriptorProto.prototype["package"] = ""; /** * FileDescriptorProto dependency. * @type {Array.} */ - $prototype.dependency = $protobuf.util.emptyArray; + FileDescriptorProto.prototype.dependency = $protobuf.util.emptyArray; /** * FileDescriptorProto publicDependency. * @type {Array.} */ - $prototype.publicDependency = $protobuf.util.emptyArray; + FileDescriptorProto.prototype.publicDependency = $protobuf.util.emptyArray; /** * FileDescriptorProto weakDependency. * @type {Array.} */ - $prototype.weakDependency = $protobuf.util.emptyArray; + FileDescriptorProto.prototype.weakDependency = $protobuf.util.emptyArray; /** * FileDescriptorProto messageType. * @type {Array.} */ - $prototype.messageType = $protobuf.util.emptyArray; + FileDescriptorProto.prototype.messageType = $protobuf.util.emptyArray; /** * FileDescriptorProto enumType. * @type {Array.} */ - $prototype.enumType = $protobuf.util.emptyArray; + FileDescriptorProto.prototype.enumType = $protobuf.util.emptyArray; /** * FileDescriptorProto service. * @type {Array.} */ - $prototype.service = $protobuf.util.emptyArray; + FileDescriptorProto.prototype.service = $protobuf.util.emptyArray; /** * FileDescriptorProto extension. * @type {Array.} */ - $prototype.extension = $protobuf.util.emptyArray; + FileDescriptorProto.prototype.extension = $protobuf.util.emptyArray; /** * FileDescriptorProto options. * @type {google.protobuf.FileOptions} */ - $prototype.options = null; + FileDescriptorProto.prototype.options = null; /** * FileDescriptorProto sourceCodeInfo. * @type {google.protobuf.SourceCodeInfo} */ - $prototype.sourceCodeInfo = null; + FileDescriptorProto.prototype.sourceCodeInfo = null; /** * FileDescriptorProto syntax. * @type {string} */ - $prototype.syntax = ""; + FileDescriptorProto.prototype.syntax = ""; - // Referenced types + // Lazily resolved referenced types var $types = {5:"google.protobuf.DescriptorProto",6:"google.protobuf.EnumDescriptorProto",7:"google.protobuf.ServiceDescriptorProto",8:"google.protobuf.FieldDescriptorProto",9:"google.protobuf.FileOptions",10:"google.protobuf.SourceCodeInfo"}; $lazyTypes.push($types); /** @@ -9016,7 +8914,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + FileDescriptorProto.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -9024,7 +8922,7 @@ $root.google = (function() { * Converts this FileDescriptorProto to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + FileDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -9047,70 +8945,67 @@ $root.google = (function() { } } - /** @alias google.protobuf.DescriptorProto.prototype */ - var $prototype = DescriptorProto.prototype; - /** * DescriptorProto name. * @type {string} */ - $prototype.name = ""; + DescriptorProto.prototype.name = ""; /** * DescriptorProto field. * @type {Array.} */ - $prototype.field = $protobuf.util.emptyArray; + DescriptorProto.prototype.field = $protobuf.util.emptyArray; /** * DescriptorProto extension. * @type {Array.} */ - $prototype.extension = $protobuf.util.emptyArray; + DescriptorProto.prototype.extension = $protobuf.util.emptyArray; /** * DescriptorProto nestedType. * @type {Array.} */ - $prototype.nestedType = $protobuf.util.emptyArray; + DescriptorProto.prototype.nestedType = $protobuf.util.emptyArray; /** * DescriptorProto enumType. * @type {Array.} */ - $prototype.enumType = $protobuf.util.emptyArray; + DescriptorProto.prototype.enumType = $protobuf.util.emptyArray; /** * DescriptorProto extensionRange. * @type {Array.} */ - $prototype.extensionRange = $protobuf.util.emptyArray; + DescriptorProto.prototype.extensionRange = $protobuf.util.emptyArray; /** * DescriptorProto oneofDecl. * @type {Array.} */ - $prototype.oneofDecl = $protobuf.util.emptyArray; + DescriptorProto.prototype.oneofDecl = $protobuf.util.emptyArray; /** * DescriptorProto options. * @type {google.protobuf.MessageOptions} */ - $prototype.options = null; + DescriptorProto.prototype.options = null; /** * DescriptorProto reservedRange. * @type {Array.} */ - $prototype.reservedRange = $protobuf.util.emptyArray; + DescriptorProto.prototype.reservedRange = $protobuf.util.emptyArray; /** * DescriptorProto reservedName. * @type {Array.} */ - $prototype.reservedName = $protobuf.util.emptyArray; + DescriptorProto.prototype.reservedName = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {1:"google.protobuf.FieldDescriptorProto",2:"google.protobuf.FieldDescriptorProto",3:"google.protobuf.DescriptorProto",4:"google.protobuf.EnumDescriptorProto",5:"google.protobuf.DescriptorProto.ExtensionRange",6:"google.protobuf.OneofDescriptorProto",7:"google.protobuf.MessageOptions",8:"google.protobuf.DescriptorProto.ReservedRange"}; $lazyTypes.push($types); /** @@ -9590,7 +9485,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + DescriptorProto.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -9598,7 +9493,7 @@ $root.google = (function() { * Converts this DescriptorProto to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + DescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -9618,20 +9513,17 @@ $root.google = (function() { } } - /** @alias google.protobuf.DescriptorProto.ExtensionRange.prototype */ - var $prototype = ExtensionRange.prototype; - /** * ExtensionRange start. * @type {number} */ - $prototype.start = 0; + ExtensionRange.prototype.start = 0; /** * ExtensionRange end. * @type {number} */ - $prototype.end = 0; + ExtensionRange.prototype.end = 0; /** * Creates a new ExtensionRange instance using the specified properties. @@ -9738,7 +9630,7 @@ $root.google = (function() { * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange */ - ExtensionRange.fromObject = (function() { return function fromObject(object) { + ExtensionRange.fromObject = function fromObject(object) { var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); if (object.start !== undefined && object.start !== null) { message.start = object.start | 0; @@ -9747,7 +9639,7 @@ $root.google = (function() { message.end = object.end | 0; } return message; - };})(); + }; /** * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. @@ -9764,7 +9656,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExtensionRange.toObject = (function() { return function toObject(message, options) { + ExtensionRange.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -9789,14 +9681,14 @@ $root.google = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this ExtensionRange message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + ExtensionRange.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -9804,7 +9696,7 @@ $root.google = (function() { * Converts this ExtensionRange to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + ExtensionRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -9827,20 +9719,17 @@ $root.google = (function() { } } - /** @alias google.protobuf.DescriptorProto.ReservedRange.prototype */ - var $prototype = ReservedRange.prototype; - /** * ReservedRange start. * @type {number} */ - $prototype.start = 0; + ReservedRange.prototype.start = 0; /** * ReservedRange end. * @type {number} */ - $prototype.end = 0; + ReservedRange.prototype.end = 0; /** * Creates a new ReservedRange instance using the specified properties. @@ -9947,7 +9836,7 @@ $root.google = (function() { * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange */ - ReservedRange.fromObject = (function() { return function fromObject(object) { + ReservedRange.fromObject = function fromObject(object) { var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); if (object.start !== undefined && object.start !== null) { message.start = object.start | 0; @@ -9956,7 +9845,7 @@ $root.google = (function() { message.end = object.end | 0; } return message; - };})(); + }; /** * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. @@ -9973,7 +9862,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReservedRange.toObject = (function() { return function toObject(message, options) { + ReservedRange.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -9998,14 +9887,14 @@ $root.google = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this ReservedRange message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + ReservedRange.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -10013,7 +9902,7 @@ $root.google = (function() { * Converts this ReservedRange to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + ReservedRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -10039,70 +9928,67 @@ $root.google = (function() { } } - /** @alias google.protobuf.FieldDescriptorProto.prototype */ - var $prototype = FieldDescriptorProto.prototype; - /** * FieldDescriptorProto name. * @type {string} */ - $prototype.name = ""; + FieldDescriptorProto.prototype.name = ""; /** * FieldDescriptorProto number. * @type {number} */ - $prototype.number = 0; + FieldDescriptorProto.prototype.number = 0; /** * FieldDescriptorProto label. * @type {number} */ - $prototype.label = 1; + FieldDescriptorProto.prototype.label = 1; /** * FieldDescriptorProto type. * @type {number} */ - $prototype.type = 1; + FieldDescriptorProto.prototype.type = 1; /** * FieldDescriptorProto typeName. * @type {string} */ - $prototype.typeName = ""; + FieldDescriptorProto.prototype.typeName = ""; /** * FieldDescriptorProto extendee. * @type {string} */ - $prototype.extendee = ""; + FieldDescriptorProto.prototype.extendee = ""; /** * FieldDescriptorProto defaultValue. * @type {string} */ - $prototype.defaultValue = ""; + FieldDescriptorProto.prototype.defaultValue = ""; /** * FieldDescriptorProto oneofIndex. * @type {number} */ - $prototype.oneofIndex = 0; + FieldDescriptorProto.prototype.oneofIndex = 0; /** * FieldDescriptorProto jsonName. * @type {string} */ - $prototype.jsonName = ""; + FieldDescriptorProto.prototype.jsonName = ""; /** * FieldDescriptorProto options. * @type {google.protobuf.FieldOptions} */ - $prototype.options = null; + FieldDescriptorProto.prototype.options = null; - // Referenced types + // Lazily resolved referenced types var $types = {2:"google.protobuf.FieldDescriptorProto.Label",3:"google.protobuf.FieldDescriptorProto.Type",9:"google.protobuf.FieldOptions"}; $lazyTypes.push($types); /** @@ -10573,7 +10459,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + FieldDescriptorProto.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -10581,7 +10467,7 @@ $root.google = (function() { * Converts this FieldDescriptorProto to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + FieldDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -10670,22 +10556,19 @@ $root.google = (function() { } } - /** @alias google.protobuf.OneofDescriptorProto.prototype */ - var $prototype = OneofDescriptorProto.prototype; - /** * OneofDescriptorProto name. * @type {string} */ - $prototype.name = ""; + OneofDescriptorProto.prototype.name = ""; /** * OneofDescriptorProto options. * @type {google.protobuf.OneofOptions} */ - $prototype.options = null; + OneofDescriptorProto.prototype.options = null; - // Referenced types + // Lazily resolved referenced types var $types = {1:"google.protobuf.OneofOptions"}; $lazyTypes.push($types); /** @@ -10852,7 +10735,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + OneofDescriptorProto.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -10860,7 +10743,7 @@ $root.google = (function() { * Converts this OneofDescriptorProto to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + OneofDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -10883,28 +10766,25 @@ $root.google = (function() { } } - /** @alias google.protobuf.EnumDescriptorProto.prototype */ - var $prototype = EnumDescriptorProto.prototype; - /** * EnumDescriptorProto name. * @type {string} */ - $prototype.name = ""; + EnumDescriptorProto.prototype.name = ""; /** * EnumDescriptorProto value. * @type {Array.} */ - $prototype.value = $protobuf.util.emptyArray; + EnumDescriptorProto.prototype.value = $protobuf.util.emptyArray; /** * EnumDescriptorProto options. * @type {google.protobuf.EnumOptions} */ - $prototype.options = null; + EnumDescriptorProto.prototype.options = null; - // Referenced types + // Lazily resolved referenced types var $types = {1:"google.protobuf.EnumValueDescriptorProto",2:"google.protobuf.EnumOptions"}; $lazyTypes.push($types); /** @@ -11112,7 +10992,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + EnumDescriptorProto.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -11120,7 +11000,7 @@ $root.google = (function() { * Converts this EnumDescriptorProto to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + EnumDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -11143,28 +11023,25 @@ $root.google = (function() { } } - /** @alias google.protobuf.EnumValueDescriptorProto.prototype */ - var $prototype = EnumValueDescriptorProto.prototype; - /** * EnumValueDescriptorProto name. * @type {string} */ - $prototype.name = ""; + EnumValueDescriptorProto.prototype.name = ""; /** * EnumValueDescriptorProto number. * @type {number} */ - $prototype.number = 0; + EnumValueDescriptorProto.prototype.number = 0; /** * EnumValueDescriptorProto options. * @type {google.protobuf.EnumValueOptions} */ - $prototype.options = null; + EnumValueDescriptorProto.prototype.options = null; - // Referenced types + // Lazily resolved referenced types var $types = {2:"google.protobuf.EnumValueOptions"}; $lazyTypes.push($types); /** @@ -11353,7 +11230,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + EnumValueDescriptorProto.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -11361,7 +11238,7 @@ $root.google = (function() { * Converts this EnumValueDescriptorProto to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -11384,28 +11261,25 @@ $root.google = (function() { } } - /** @alias google.protobuf.ServiceDescriptorProto.prototype */ - var $prototype = ServiceDescriptorProto.prototype; - /** * ServiceDescriptorProto name. * @type {string} */ - $prototype.name = ""; + ServiceDescriptorProto.prototype.name = ""; /** * ServiceDescriptorProto method. * @type {Array.} */ - $prototype.method = $protobuf.util.emptyArray; + ServiceDescriptorProto.prototype.method = $protobuf.util.emptyArray; /** * ServiceDescriptorProto options. * @type {google.protobuf.ServiceOptions} */ - $prototype.options = null; + ServiceDescriptorProto.prototype.options = null; - // Referenced types + // Lazily resolved referenced types var $types = {1:"google.protobuf.MethodDescriptorProto",2:"google.protobuf.ServiceOptions"}; $lazyTypes.push($types); /** @@ -11613,7 +11487,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + ServiceDescriptorProto.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -11621,7 +11495,7 @@ $root.google = (function() { * Converts this ServiceDescriptorProto to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + ServiceDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -11644,46 +11518,43 @@ $root.google = (function() { } } - /** @alias google.protobuf.MethodDescriptorProto.prototype */ - var $prototype = MethodDescriptorProto.prototype; - /** * MethodDescriptorProto name. * @type {string} */ - $prototype.name = ""; + MethodDescriptorProto.prototype.name = ""; /** * MethodDescriptorProto inputType. * @type {string} */ - $prototype.inputType = ""; + MethodDescriptorProto.prototype.inputType = ""; /** * MethodDescriptorProto outputType. * @type {string} */ - $prototype.outputType = ""; + MethodDescriptorProto.prototype.outputType = ""; /** * MethodDescriptorProto options. * @type {google.protobuf.MethodOptions} */ - $prototype.options = null; + MethodDescriptorProto.prototype.options = null; /** * MethodDescriptorProto clientStreaming. * @type {boolean} */ - $prototype.clientStreaming = false; + MethodDescriptorProto.prototype.clientStreaming = false; /** * MethodDescriptorProto serverStreaming. * @type {boolean} */ - $prototype.serverStreaming = false; + MethodDescriptorProto.prototype.serverStreaming = false; - // Referenced types + // Lazily resolved referenced types var $types = {3:"google.protobuf.MethodOptions"}; $lazyTypes.push($types); /** @@ -11938,7 +11809,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + MethodDescriptorProto.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -11946,7 +11817,7 @@ $root.google = (function() { * Converts this MethodDescriptorProto to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + MethodDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -11969,100 +11840,97 @@ $root.google = (function() { } } - /** @alias google.protobuf.FileOptions.prototype */ - var $prototype = FileOptions.prototype; - /** * FileOptions javaPackage. * @type {string} */ - $prototype.javaPackage = ""; + FileOptions.prototype.javaPackage = ""; /** * FileOptions javaOuterClassname. * @type {string} */ - $prototype.javaOuterClassname = ""; + FileOptions.prototype.javaOuterClassname = ""; /** * FileOptions javaMultipleFiles. * @type {boolean} */ - $prototype.javaMultipleFiles = false; + FileOptions.prototype.javaMultipleFiles = false; /** * FileOptions javaGenerateEqualsAndHash. * @type {boolean} */ - $prototype.javaGenerateEqualsAndHash = false; + FileOptions.prototype.javaGenerateEqualsAndHash = false; /** * FileOptions javaStringCheckUtf8. * @type {boolean} */ - $prototype.javaStringCheckUtf8 = false; + FileOptions.prototype.javaStringCheckUtf8 = false; /** * FileOptions optimizeFor. * @type {number} */ - $prototype.optimizeFor = undefined; + FileOptions.prototype.optimizeFor = undefined; /** * FileOptions goPackage. * @type {string} */ - $prototype.goPackage = ""; + FileOptions.prototype.goPackage = ""; /** * FileOptions ccGenericServices. * @type {boolean} */ - $prototype.ccGenericServices = false; + FileOptions.prototype.ccGenericServices = false; /** * FileOptions javaGenericServices. * @type {boolean} */ - $prototype.javaGenericServices = false; + FileOptions.prototype.javaGenericServices = false; /** * FileOptions pyGenericServices. * @type {boolean} */ - $prototype.pyGenericServices = false; + FileOptions.prototype.pyGenericServices = false; /** * FileOptions deprecated. * @type {boolean} */ - $prototype.deprecated = false; + FileOptions.prototype.deprecated = false; /** * FileOptions ccEnableArenas. * @type {boolean} */ - $prototype.ccEnableArenas = false; + FileOptions.prototype.ccEnableArenas = false; /** * FileOptions objcClassPrefix. * @type {string} */ - $prototype.objcClassPrefix = ""; + FileOptions.prototype.objcClassPrefix = ""; /** * FileOptions csharpNamespace. * @type {string} */ - $prototype.csharpNamespace = ""; + FileOptions.prototype.csharpNamespace = ""; /** * FileOptions uninterpretedOption. * @type {Array.} */ - $prototype.uninterpretedOption = $protobuf.util.emptyArray; + FileOptions.prototype.uninterpretedOption = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {5:"google.protobuf.FileOptions.OptimizeMode",14:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); /** @@ -12552,7 +12420,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + FileOptions.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -12560,7 +12428,7 @@ $root.google = (function() { * Converts this FileOptions to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + FileOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -12601,40 +12469,37 @@ $root.google = (function() { } } - /** @alias google.protobuf.MessageOptions.prototype */ - var $prototype = MessageOptions.prototype; - /** * MessageOptions messageSetWireFormat. * @type {boolean} */ - $prototype.messageSetWireFormat = false; + MessageOptions.prototype.messageSetWireFormat = false; /** * MessageOptions noStandardDescriptorAccessor. * @type {boolean} */ - $prototype.noStandardDescriptorAccessor = false; + MessageOptions.prototype.noStandardDescriptorAccessor = false; /** * MessageOptions deprecated. * @type {boolean} */ - $prototype.deprecated = false; + MessageOptions.prototype.deprecated = false; /** * MessageOptions mapEntry. * @type {boolean} */ - $prototype.mapEntry = false; + MessageOptions.prototype.mapEntry = false; /** * MessageOptions uninterpretedOption. * @type {Array.} */ - $prototype.uninterpretedOption = $protobuf.util.emptyArray; + MessageOptions.prototype.uninterpretedOption = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {4:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); /** @@ -12885,7 +12750,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + MessageOptions.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -12893,7 +12758,7 @@ $root.google = (function() { * Converts this MessageOptions to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + MessageOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -12916,52 +12781,49 @@ $root.google = (function() { } } - /** @alias google.protobuf.FieldOptions.prototype */ - var $prototype = FieldOptions.prototype; - /** * FieldOptions ctype. * @type {number} */ - $prototype.ctype = undefined; + FieldOptions.prototype.ctype = undefined; /** * FieldOptions packed. * @type {boolean} */ - $prototype.packed = false; + FieldOptions.prototype.packed = false; /** * FieldOptions jstype. * @type {number} */ - $prototype.jstype = undefined; + FieldOptions.prototype.jstype = undefined; /** * FieldOptions lazy. * @type {boolean} */ - $prototype.lazy = false; + FieldOptions.prototype.lazy = false; /** * FieldOptions deprecated. * @type {boolean} */ - $prototype.deprecated = false; + FieldOptions.prototype.deprecated = false; /** * FieldOptions weak. * @type {boolean} */ - $prototype.weak = false; + FieldOptions.prototype.weak = false; /** * FieldOptions uninterpretedOption. * @type {Array.} */ - $prototype.uninterpretedOption = $protobuf.util.emptyArray; + FieldOptions.prototype.uninterpretedOption = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {0:"google.protobuf.FieldOptions.CType",2:"google.protobuf.FieldOptions.JSType",6:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); /** @@ -13294,7 +13156,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + FieldOptions.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -13302,7 +13164,7 @@ $root.google = (function() { * Converts this FieldOptions to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + FieldOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -13361,16 +13223,13 @@ $root.google = (function() { } } - /** @alias google.protobuf.OneofOptions.prototype */ - var $prototype = OneofOptions.prototype; - /** * OneofOptions uninterpretedOption. * @type {Array.} */ - $prototype.uninterpretedOption = $protobuf.util.emptyArray; + OneofOptions.prototype.uninterpretedOption = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {0:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); /** @@ -13531,7 +13390,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + OneofOptions.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -13539,7 +13398,7 @@ $root.google = (function() { * Converts this OneofOptions to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + OneofOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -13562,35 +13421,32 @@ $root.google = (function() { } } - /** @alias google.protobuf.EnumOptions.prototype */ - var $prototype = EnumOptions.prototype; - /** * EnumOptions allowAlias. * @type {boolean} */ - $prototype.allowAlias = false; + EnumOptions.prototype.allowAlias = false; /** * EnumOptions deprecated. * @type {boolean} */ - $prototype.deprecated = false; + EnumOptions.prototype.deprecated = false; /** * EnumOptions uninterpretedOption. * @type {Array.} */ - $prototype.uninterpretedOption = $protobuf.util.emptyArray; + EnumOptions.prototype.uninterpretedOption = $protobuf.util.emptyArray; /** * EnumOptions .jspb.test.IsExtension.simpleOption. * @name google.protobuf.EnumOptions#.jspb.test.IsExtension.simpleOption * @type {string} */ - $prototype[".jspb.test.IsExtension.simpleOption"] = ""; + EnumOptions.prototype[".jspb.test.IsExtension.simpleOption"] = ""; - // Referenced types + // Lazily resolved referenced types var $types = {2:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); /** @@ -13819,7 +13675,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + EnumOptions.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -13827,7 +13683,7 @@ $root.google = (function() { * Converts this EnumOptions to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + EnumOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -13850,22 +13706,19 @@ $root.google = (function() { } } - /** @alias google.protobuf.EnumValueOptions.prototype */ - var $prototype = EnumValueOptions.prototype; - /** * EnumValueOptions deprecated. * @type {boolean} */ - $prototype.deprecated = false; + EnumValueOptions.prototype.deprecated = false; /** * EnumValueOptions uninterpretedOption. * @type {Array.} */ - $prototype.uninterpretedOption = $protobuf.util.emptyArray; + EnumValueOptions.prototype.uninterpretedOption = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {1:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); /** @@ -14050,7 +13903,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + EnumValueOptions.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -14058,7 +13911,7 @@ $root.google = (function() { * Converts this EnumValueOptions to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + EnumValueOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -14081,22 +13934,19 @@ $root.google = (function() { } } - /** @alias google.protobuf.ServiceOptions.prototype */ - var $prototype = ServiceOptions.prototype; - /** * ServiceOptions deprecated. * @type {boolean} */ - $prototype.deprecated = false; + ServiceOptions.prototype.deprecated = false; /** * ServiceOptions uninterpretedOption. * @type {Array.} */ - $prototype.uninterpretedOption = $protobuf.util.emptyArray; + ServiceOptions.prototype.uninterpretedOption = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {1:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); /** @@ -14281,7 +14131,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + ServiceOptions.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -14289,7 +14139,7 @@ $root.google = (function() { * Converts this ServiceOptions to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -14312,28 +14162,25 @@ $root.google = (function() { } } - /** @alias google.protobuf.MethodOptions.prototype */ - var $prototype = MethodOptions.prototype; - /** * MethodOptions deprecated. * @type {boolean} */ - $prototype.deprecated = false; + MethodOptions.prototype.deprecated = false; /** * MethodOptions idempotencyLevel. * @type {number} */ - $prototype.idempotencyLevel = undefined; + MethodOptions.prototype.idempotencyLevel = undefined; /** * MethodOptions uninterpretedOption. * @type {Array.} */ - $prototype.uninterpretedOption = $protobuf.util.emptyArray; + MethodOptions.prototype.uninterpretedOption = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {1:"google.protobuf.MethodOptions.IdempotencyLevel",2:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); /** @@ -14559,7 +14406,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + MethodOptions.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -14567,7 +14414,7 @@ $root.google = (function() { * Converts this MethodOptions to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -14608,52 +14455,49 @@ $root.google = (function() { } } - /** @alias google.protobuf.UninterpretedOption.prototype */ - var $prototype = UninterpretedOption.prototype; - /** * UninterpretedOption name. * @type {Array.} */ - $prototype.name = $protobuf.util.emptyArray; + UninterpretedOption.prototype.name = $protobuf.util.emptyArray; /** * UninterpretedOption identifierValue. * @type {string} */ - $prototype.identifierValue = ""; + UninterpretedOption.prototype.identifierValue = ""; /** * UninterpretedOption positiveIntValue. * @type {number|$protobuf.Long} */ - $prototype.positiveIntValue = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,true) : 0; + UninterpretedOption.prototype.positiveIntValue = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,true) : 0; /** * UninterpretedOption negativeIntValue. * @type {number|$protobuf.Long} */ - $prototype.negativeIntValue = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,false) : 0; + UninterpretedOption.prototype.negativeIntValue = $protobuf.util.Long ? $protobuf.util.Long.fromBits(0,0,false) : 0; /** * UninterpretedOption doubleValue. * @type {number} */ - $prototype.doubleValue = 0; + UninterpretedOption.prototype.doubleValue = 0; /** * UninterpretedOption stringValue. * @type {Uint8Array} */ - $prototype.stringValue = $protobuf.util.newBuffer([]); + UninterpretedOption.prototype.stringValue = $protobuf.util.newBuffer([]); /** * UninterpretedOption aggregateValue. * @type {string} */ - $prototype.aggregateValue = ""; + UninterpretedOption.prototype.aggregateValue = ""; - // Referenced types + // Lazily resolved referenced types var $types = {0:"google.protobuf.UninterpretedOption.NamePart"}; $lazyTypes.push($types); /** @@ -15000,7 +14844,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + UninterpretedOption.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -15008,7 +14852,7 @@ $root.google = (function() { * Converts this UninterpretedOption to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + UninterpretedOption.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -15028,20 +14872,17 @@ $root.google = (function() { } } - /** @alias google.protobuf.UninterpretedOption.NamePart.prototype */ - var $prototype = NamePart.prototype; - /** * NamePart namePart. * @type {string} */ - $prototype.namePart = ""; + NamePart.prototype.namePart = ""; /** * NamePart isExtension. * @type {boolean} */ - $prototype.isExtension = false; + NamePart.prototype.isExtension = false; /** * Creates a new NamePart instance using the specified properties. @@ -15140,7 +14981,7 @@ $root.google = (function() { * @param {Object.} object Plain object * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart */ - NamePart.fromObject = (function() { return function fromObject(object) { + NamePart.fromObject = function fromObject(object) { var message = new $root.google.protobuf.UninterpretedOption.NamePart(); if (object.namePart !== undefined && object.namePart !== null) { message.namePart = String(object.namePart); @@ -15149,7 +14990,7 @@ $root.google = (function() { message.isExtension = Boolean(object.isExtension); } return message; - };})(); + }; /** * Creates a NamePart message from a plain object. Also converts values to their respective internal types. @@ -15166,7 +15007,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NamePart.toObject = (function() { return function toObject(message, options) { + NamePart.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -15191,14 +15032,14 @@ $root.google = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this NamePart message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + NamePart.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -15206,7 +15047,7 @@ $root.google = (function() { * Converts this NamePart to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + NamePart.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -15232,16 +15073,13 @@ $root.google = (function() { } } - /** @alias google.protobuf.SourceCodeInfo.prototype */ - var $prototype = SourceCodeInfo.prototype; - /** * SourceCodeInfo location. * @type {Array.} */ - $prototype.location = $protobuf.util.emptyArray; + SourceCodeInfo.prototype.location = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {0:"google.protobuf.SourceCodeInfo.Location"}; $lazyTypes.push($types); /** @@ -15402,7 +15240,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + SourceCodeInfo.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -15410,7 +15248,7 @@ $root.google = (function() { * Converts this SourceCodeInfo to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + SourceCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -15430,38 +15268,35 @@ $root.google = (function() { } } - /** @alias google.protobuf.SourceCodeInfo.Location.prototype */ - var $prototype = Location.prototype; - /** * Location path. * @type {Array.} */ - $prototype.path = $protobuf.util.emptyArray; + Location.prototype.path = $protobuf.util.emptyArray; /** * Location span. * @type {Array.} */ - $prototype.span = $protobuf.util.emptyArray; + Location.prototype.span = $protobuf.util.emptyArray; /** * Location leadingComments. * @type {string} */ - $prototype.leadingComments = ""; + Location.prototype.leadingComments = ""; /** * Location trailingComments. * @type {string} */ - $prototype.trailingComments = ""; + Location.prototype.trailingComments = ""; /** * Location leadingDetachedComments. * @type {Array.} */ - $prototype.leadingDetachedComments = $protobuf.util.emptyArray; + Location.prototype.leadingDetachedComments = $protobuf.util.emptyArray; /** * Creates a new Location instance using the specified properties. @@ -15652,7 +15487,7 @@ $root.google = (function() { * @param {Object.} object Plain object * @returns {google.protobuf.SourceCodeInfo.Location} Location */ - Location.fromObject = (function() { return function fromObject(object) { + Location.fromObject = function fromObject(object) { var message = new $root.google.protobuf.SourceCodeInfo.Location(); if (object.path) { message.path = []; @@ -15679,7 +15514,7 @@ $root.google = (function() { } } return message; - };})(); + }; /** * Creates a Location message from a plain object. Also converts values to their respective internal types. @@ -15696,7 +15531,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Location.toObject = (function() { return function toObject(message, options) { + Location.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -15753,14 +15588,14 @@ $root.google = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this Location message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Location.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -15768,7 +15603,7 @@ $root.google = (function() { * Converts this Location to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Location.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -15794,16 +15629,13 @@ $root.google = (function() { } } - /** @alias google.protobuf.GeneratedCodeInfo.prototype */ - var $prototype = GeneratedCodeInfo.prototype; - /** * GeneratedCodeInfo annotation. * @type {Array.} */ - $prototype.annotation = $protobuf.util.emptyArray; + GeneratedCodeInfo.prototype.annotation = $protobuf.util.emptyArray; - // Referenced types + // Lazily resolved referenced types var $types = {0:"google.protobuf.GeneratedCodeInfo.Annotation"}; $lazyTypes.push($types); /** @@ -15964,7 +15796,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + GeneratedCodeInfo.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -15972,7 +15804,7 @@ $root.google = (function() { * Converts this GeneratedCodeInfo to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + GeneratedCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; @@ -15992,32 +15824,29 @@ $root.google = (function() { } } - /** @alias google.protobuf.GeneratedCodeInfo.Annotation.prototype */ - var $prototype = Annotation.prototype; - /** * Annotation path. * @type {Array.} */ - $prototype.path = $protobuf.util.emptyArray; + Annotation.prototype.path = $protobuf.util.emptyArray; /** * Annotation sourceFile. * @type {string} */ - $prototype.sourceFile = ""; + Annotation.prototype.sourceFile = ""; /** * Annotation begin. * @type {number} */ - $prototype.begin = 0; + Annotation.prototype.begin = 0; /** * Annotation end. * @type {number} */ - $prototype.end = 0; + Annotation.prototype.end = 0; /** * Creates a new Annotation instance using the specified properties. @@ -16167,7 +15996,7 @@ $root.google = (function() { * @param {Object.} object Plain object * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation */ - Annotation.fromObject = (function() { return function fromObject(object) { + Annotation.fromObject = function fromObject(object) { var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); if (object.path) { message.path = []; @@ -16185,7 +16014,7 @@ $root.google = (function() { message.end = object.end | 0; } return message; - };})(); + }; /** * Creates an Annotation message from a plain object. Also converts values to their respective internal types. @@ -16202,7 +16031,7 @@ $root.google = (function() { * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Annotation.toObject = (function() { return function toObject(message, options) { + Annotation.toObject = function toObject(message, options) { if (!options) { options = {}; } @@ -16246,14 +16075,14 @@ $root.google = (function() { } } return object; - };})(); + }; /** * Creates a plain object from this Annotation message. Also converts values to other types if specified. * @param {$protobuf.ConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - $prototype.toObject = function toObject(options) { + Annotation.prototype.toObject = function toObject(options) { return this.constructor.toObject(this, options); }; @@ -16261,7 +16090,7 @@ $root.google = (function() { * Converts this Annotation to JSON. * @returns {Object.} JSON object */ - $prototype.toJSON = function toJSON() { + Annotation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; diff --git a/tests/data/test.min.js b/tests/data/test.min.js new file mode 100644 index 000000000..dda129ffc --- /dev/null +++ b/tests/data/test.min.js @@ -0,0 +1,7 @@ +"use strict";var $protobuf=require("../../runtime"),$lazyTypes=[],$root={};$root.jspb=function(){var e={};return e.test=function(){var e={};return e.Empty=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(){return null},e.fromObject=function(){return new $root.jspb.test.Empty},e.from=e.fromObject,e.toObject=function(){return{}},e.prototype.toObject=function(e){return this.constructor.toObject(this,e)},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.OuterEnum=function(){var e={},t=Object.create(e);return t[e[1]="FOO"]=1,t[e[2]="BAR"]=2,t}(),e.EnumContainer=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:o.outerEnum=t.uint32();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.outerEnum)switch(e.outerEnum){default:return"outerEnum: enum value expected";case 1:case 2:}return null},e.fromObject=function(e){var t=new $root.jspb.test.EnumContainer;switch(e.outerEnum){case"FOO":case 1:t.outerEnum=1;break;case"BAR":case 2:t.outerEnum=2}return t},e.from=e.fromObject,e.toObject=function(e){return function(t,n){n||(n={});var r={};n.defaults&&(r.outerEnum=n.enums===String?"FOO":1);for(var o=Object.keys(t),i=0;i>>3){case 1:o.aString=t.string();break;case 2:o.aRepeatedString&&o.aRepeatedString.length||(o.aRepeatedString=[]),o.aRepeatedString.push(t.string());break;case 3:o.aBoolean=t.bool();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(!e.isString(t.aString))return"aString: string expected";if(void 0!==t.aRepeatedString){if(!Array.isArray(t.aRepeatedString))return"aRepeatedString: array expected";for(var n=0;n>>3){case 1:o.aString=t.string();break;case 2:o.aRepeatedString&&o.aRepeatedString.length||(o.aRepeatedString=[]),o.aRepeatedString.push(t.string());break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(!e.isString(t.aString))return"aString: string expected";if(void 0!==t.aRepeatedString){if(!Array.isArray(t.aRepeatedString))return"aRepeatedString: array expected";for(var n=0;n>>3){case 1:o.normal=t.string();break;case 2:o.default=t.string();break;case 3:o.function=t.string();break;case 4:o.var=t.string();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return e.isString(t.normal)?e.isString(t.default)?e.isString(t.function)?e.isString(t.var)?null:"var: string expected":"function: string expected":"default: string expected":"normal: string expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.jspb.test.SpecialCases;return void 0!==e.normal&&null!==e.normal&&(t.normal=String(e.normal)),void 0!==e.default&&null!==e.default&&(t.default=String(e.default)),void 0!==e.function&&null!==e.function&&(t.function=String(e.function)),void 0!==e.var&&null!==e.var&&(t.var=String(e.var)),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.normal="",n.default="",n.function="",n.var="");for(var r=Object.keys(e),o=0;o>>3){case 1:i.aString=n.string();break;case 2:i.aBool=n.bool();break;case 3:i.aNestedMessage=t[2].decode(n,n.uint32());break;case 4:i.aRepeatedMessage&&i.aRepeatedMessage.length||(i.aRepeatedMessage=[]),i.aRepeatedMessage.push(t[3].decode(n,n.uint32()));break;case 5:i.aRepeatedString&&i.aRepeatedString.length||(i.aRepeatedString=[]),i.aRepeatedString.push(n.string());break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.aString&&!e.isString(n.aString))return"aString: string expected";if("boolean"!=typeof n.aBool)return"aBool: boolean expected";if(void 0!==n.aNestedMessage&&null!==n.aNestedMessage){var r=t[2].verify(n.aNestedMessage);if(r)return"aNestedMessage."+r}if(void 0!==n.aRepeatedMessage){if(!Array.isArray(n.aRepeatedMessage))return"aRepeatedMessage: array expected";for(var o=0;o>>3){case 1:o.anInt=t.int32();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return void 0===t.anInt||e.isInteger(t.anInt)?null:"anInt: integer expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.jspb.test.OptionalFields.Nested;return void 0!==e.anInt&&null!==e.anInt&&(t.anInt=0|e.anInt),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.anInt=0);for(var r=Object.keys(e),o=0;o>>3){case 1:i.str1=n.string();break;case 2:i.str2=n.string();break;case 3:i.str3=n.string();break;case 100:i[".jspb.test.IsExtension.extField"]=t[3].decode(n,n.uint32());break;case 101:i[".jspb.test.IndirectExtension.simple"]=t[4].decode(n,n.uint32());break;case 102:i[".jspb.test.IndirectExtension.str"]=n.string();break;case 103:i[".jspb.test.IndirectExtension.repeatedStr"]&&i[".jspb.test.IndirectExtension.repeatedStr"].length||(i[".jspb.test.IndirectExtension.repeatedStr"]=[]),i[".jspb.test.IndirectExtension.repeatedStr"].push(n.string());break;case 104:i[".jspb.test.IndirectExtension.repeatedSimple"]&&i[".jspb.test.IndirectExtension.repeatedSimple"].length||(i[".jspb.test.IndirectExtension.repeatedSimple"]=[]),i[".jspb.test.IndirectExtension.repeatedSimple"].push(t[7].decode(n,n.uint32()));break;case 105:i[".jspb.test.simple1"]=t[8].decode(n,n.uint32());break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.str1&&!e.isString(n.str1))return"str1: string expected";if(void 0!==n.str2&&!e.isString(n.str2))return"str2: string expected";if(void 0!==n.str3&&!e.isString(n.str3))return"str3: string expected";if(void 0!==n[".jspb.test.IsExtension.extField"]&&null!==n[".jspb.test.IsExtension.extField"]){var r=t[3].verify(n[".jspb.test.IsExtension.extField"]);if(r)return".jspb.test.IsExtension.extField."+r}if(void 0!==n[".jspb.test.IndirectExtension.simple"]&&null!==n[".jspb.test.IndirectExtension.simple"]){var r=t[4].verify(n[".jspb.test.IndirectExtension.simple"]);if(r)return".jspb.test.IndirectExtension.simple."+r}if(void 0!==n[".jspb.test.IndirectExtension.str"]&&!e.isString(n[".jspb.test.IndirectExtension.str"]))return".jspb.test.IndirectExtension.str: string expected";if(void 0!==n[".jspb.test.IndirectExtension.repeatedStr"]){if(!Array.isArray(n[".jspb.test.IndirectExtension.repeatedStr"]))return".jspb.test.IndirectExtension.repeatedStr: array expected";for(var o=0;o>>3){case 1:i.aString=n.string();break;case 9:i.anOutOfOrderBool=n.bool();break;case 4:i.aNestedMessage=t[2].decode(n,n.uint32());break;case 5:i.aRepeatedMessage&&i.aRepeatedMessage.length||(i.aRepeatedMessage=[]),i.aRepeatedMessage.push(t[3].decode(n,n.uint32()));break;case 7:i.aRepeatedString&&i.aRepeatedString.length||(i.aRepeatedString=[]),i.aRepeatedString.push(n.string());break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(!e.isString(n.aString))return"aString: string expected";if("boolean"!=typeof n.anOutOfOrderBool)return"anOutOfOrderBool: boolean expected";if(void 0!==n.aNestedMessage&&null!==n.aNestedMessage){var r=t[2].verify(n.aNestedMessage);if(r)return"aNestedMessage."+r}if(void 0!==n.aRepeatedMessage){if(!Array.isArray(n.aRepeatedMessage))return"aRepeatedMessage: array expected";for(var o=0;o>>3){case 2:o.anInt=t.int32();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return e.isInteger(t.anInt)?null:"anInt: integer expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.jspb.test.Complex.Nested;return void 0!==e.anInt&&null!==e.anInt&&(t.anInt=0|e.anInt),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.anInt=0);for(var r=Object.keys(e),o=0;o>>3){default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(){return null},e.fromObject=function(){return new $root.jspb.test.OuterMessage},e.from=e.fromObject,e.toObject=function(){return{}},e.prototype.toObject=function(e){return this.constructor.toObject(this,e)},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e.Complex=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:o.innerComplexField=t.int32();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return void 0===t.innerComplexField||e.isInteger(t.innerComplexField)?null:"innerComplexField: integer expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.jspb.test.OuterMessage.Complex;return void 0!==e.innerComplexField&&null!==e.innerComplexField&&(t.innerComplexField=0|e.innerComplexField),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.innerComplexField=0);for(var r=Object.keys(e),o=0;o>>3){case 1:o.ext1=t.string();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return void 0===t.ext1||e.isString(t.ext1)?null:"ext1: string expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.jspb.test.IsExtension;return void 0!==e.ext1&&null!==e.ext1&&(t.ext1=String(e.ext1)),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.ext1="");for(var r=Object.keys(e),o=0;o>>3){default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(){return null},e.fromObject=function(){return new $root.jspb.test.IndirectExtension},e.from=e.fromObject,e.toObject=function(){return{}},e.prototype.toObject=function(e){return this.constructor.toObject(this,e)},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.DefaultValues=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n'\"abc",e.prototype.boolField=!0,e.prototype.intField=$protobuf.util.Long?$protobuf.util.Long.fromBits(11,0,!1):11,e.prototype.enumField=void 0,e.prototype.emptyField="",e.prototype.bytesField=$protobuf.util.newBuffer([109,111,111]);var t={3:"jspb.test.DefaultValues.Enum"};return $lazyTypes.push(t),e.create=function(t){return new e(t)},e.encode=function(e,t){return function(n,r){return r||(r=e.create()),void 0!==n.stringField&&"default<>'\"abc"!==n.stringField&&r.uint32(10).string(n.stringField),void 0!==n.boolField&&n.boolField!==!0&&r.uint32(16).bool(n.boolField),void 0!==n.intField&&null!==n.intField&&t.longNe(n.intField,11,0)&&r.uint32(24).int64(n.intField),void 0!==n.enumField&&void 0!==n.enumField&&r.uint32(32).uint32(n.enumField),void 0!==n.emptyField&&""!==n.emptyField&&r.uint32(50).string(n.emptyField),n.bytesField&&n.bytesField.length&&t.arrayNe(n.bytesField,[109,111,111])&&r.uint32(66).bytes(n.bytesField),r}}($protobuf.Writer,$protobuf.util),e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e){return function(t,n){t instanceof e||(t=e.create(t));for(var r=void 0===n?t.len:t.pos+n,o=new $root.jspb.test.DefaultValues;t.pos>>3){case 1:o.stringField=t.string();break;case 2:o.boolField=t.bool();break;case 3:o.intField=t.int64();break;case 4:o.enumField=t.uint32();break;case 6:o.emptyField=t.string();break;case 8:o.bytesField=t.bytes();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(void 0!==t.stringField&&!e.isString(t.stringField))return"stringField: string expected";if(void 0!==t.boolField&&"boolean"!=typeof t.boolField)return"boolField: boolean expected";if(void 0!==t.intField&&!(e.isInteger(t.intField)||t.intField&&e.isInteger(t.intField.low)&&e.isInteger(t.intField.high)))return"intField: integer|Long expected";if(void 0!==t.enumField)switch(t.enumField){default:return"enumField: enum value expected";case 13:case 77:}return void 0===t.emptyField||e.isString(t.emptyField)?void 0===t.bytesField||t.bytesField&&"number"==typeof t.bytesField.length||e.isString(t.bytesField)?null:"bytesField: buffer expected":"emptyField: string expected"}}($protobuf.util),e.fromObject=function(e){return function(t){var n=new $root.jspb.test.DefaultValues;switch(void 0!==t.stringField&&null!==t.stringField&&(n.stringField=String(t.stringField)),void 0!==t.boolField&&null!==t.boolField&&(n.boolField=Boolean(t.boolField)),void 0!==t.intField&&null!==t.intField&&(e.Long?(n.intField=e.Long.fromValue(t.intField)).unsigned=!1:"string"==typeof t.intField?n.intField=parseInt(t.intField,10):"number"==typeof t.intField?n.intField=t.intField:"object"==typeof t.intField&&(n.intField=new e.LongBits(t.intField.low,t.intField.high).toNumber())),t.enumField){case"E1":case 13:n.enumField=13;break;case"E2":case 77:n.enumField=77}return void 0!==t.emptyField&&null!==t.emptyField&&(n.emptyField=String(t.emptyField)),void 0!==t.bytesField&&null!==t.bytesField&&("string"==typeof t.bytesField?e.base64.decode(t.bytesField,n.bytesField=e.newBuffer(e.base64.length(t.bytesField)),0):t.bytesField&&t.bytesField.length&&(n.bytesField=t.bytesField)),n}}($protobuf.util),e.from=e.fromObject,e.toObject=function(e,t){return function(n,r){r||(r={});var o={};if(r.defaults){if(o.stringField="default<>'\"abc",o.boolField=!0,e.Long){var i=new e.Long(11,0,!1);o.intField=r.longs===String?i.toString():r.longs===Number?i.toNumber():i}else o.intField=r.longs===String?"11":11;o.enumField=(r.enums===String,void 0),o.emptyField="",o.bytesField=r.bytes===String?"moo":[109,111,111]}for(var a=Object.keys(n),u=0;u>>3){case 1:o.optionalFloatField=t.float();break;case 2:o.requiredFloatField=t.float();break;case 3:if(o.repeatedFloatField&&o.repeatedFloatField.length||(o.repeatedFloatField=[]),2===(7&i))for(var a=t.uint32()+t.pos;t.pos>>3){case 1:i.str=n.string();break;case 3:i.simple1=t[1].decode(n,n.uint32());break;case 5:i.simple2&&i.simple2.length||(i.simple2=[]),i.simple2.push(t[2].decode(n,n.uint32()));break;case 6:i.bytesField=n.bytes();break;case 7:i.unused=n.string();break;case 100:i[".jspb.test.CloneExtension.extField"]=t[5].decode(n,n.uint32());break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.str&&!e.isString(n.str))return"str: string expected";if(void 0!==n.simple1&&null!==n.simple1){var r=t[1].verify(n.simple1);if(r)return"simple1."+r}if(void 0!==n.simple2){if(!Array.isArray(n.simple2))return"simple2: array expected";for(var o=0;o>>3){case 2:o.ext=t.string();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return void 0===t.ext||e.isString(t.ext)?null:"ext: string expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.jspb.test.CloneExtension;return void 0!==e.ext&&null!==e.ext&&(t.ext=String(e.ext)),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.ext="");for(var r=Object.keys(e),o=0;o>>3){case 1:i.repeatedGroup&&i.repeatedGroup.length||(i.repeatedGroup=[]),i.repeatedGroup.push(t[0].decode(n));break;case 2:i.requiredGroup=t[1].decode(n);break;case 3:i.optionalGroup=t[2].decode(n);break;case 4:i.id=n.string();break;case 5:i.requiredSimple=t[4].decode(n,n.uint32());break;case 6:i.optionalSimple=t[5].decode(n,n.uint32());break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.repeatedGroup){if(!Array.isArray(n.repeatedGroup))return"repeatedGroup: array expected";for(var r=0;r>>3){case 1:o.id=t.string();break;case 2:if(o.someBool&&o.someBool.length||(o.someBool=[]),2===(7&i))for(var a=t.uint32()+t.pos;t.pos>>3){case 1:o.id=t.string();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return e.isString(t.id)?null:"id: string expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.jspb.test.TestGroup.RequiredGroup;return void 0!==e.id&&null!==e.id&&(t.id=String(e.id)),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.id="");for(var r=Object.keys(e),o=0;o>>3){case 1:o.id=t.string();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return e.isString(t.id)?null:"id: string expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.jspb.test.TestGroup.OptionalGroup;return void 0!==e.id&&null!==e.id&&(t.id=String(e.id)),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.id="");for(var r=Object.keys(e),o=0;o>>3){case 1:i.group=t[0].decode(n);break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(void 0!==t.group&&null!==t.group){var n=e[0].verify(t.group);if(n)return"group."+n}return null}}(t),e.fromObject=function(e){return function(t){var n=new $root.jspb.test.TestGroup1; +return void 0!==t.group&&null!==t.group&&(n.group=e[0].fromObject(t.group)),n}}(t),e.from=e.fromObject,e.toObject=function(e){return function(t,n){n||(n={});var r={};n.defaults&&(r.group=null);for(var o=Object.keys(t),i=0;i>>3){case 1:o.extension=t.int32();break;case 10:o[".jspb.test.TestReservedNamesExtension.foo"]=t.int32();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return void 0===t.extension||e.isInteger(t.extension)?void 0===t[".jspb.test.TestReservedNamesExtension.foo"]||e.isInteger(t[".jspb.test.TestReservedNamesExtension.foo"])?null:".jspb.test.TestReservedNamesExtension.foo: integer expected":"extension: integer expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.jspb.test.TestReservedNames;return void 0!==e.extension&&null!==e.extension&&(t.extension=0|e.extension),void 0!==e[".jspb.test.TestReservedNamesExtension.foo"]&&null!==e[".jspb.test.TestReservedNamesExtension.foo"]&&(t[".jspb.test.TestReservedNamesExtension.foo"]=0|e[".jspb.test.TestReservedNamesExtension.foo"]),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.extension=0,n[".jspb.test.TestReservedNamesExtension.foo"]=0);for(var r=Object.keys(e),o=0;o>>3){default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(){return null},e.fromObject=function(){return new $root.jspb.test.TestReservedNamesExtension},e.from=e.fromObject,e.toObject=function(){return{}},e.prototype.toObject=function(e){return this.constructor.toObject(this,e)},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.TestMessageWithOneof=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 3:i.pone=n.string();break;case 5:i.pthree=n.string();break;case 6:i.rone=t[2].decode(n,n.uint32());break;case 7:i.rtwo=n.string();break;case 8:i.normalField=n.bool();break;case 9:i.repeatedField&&i.repeatedField.length||(i.repeatedField=[]),i.repeatedField.push(n.string());break;case 10:i.aone=n.int32();break;case 11:i.atwo=n.int32();break;case 12:i.bone=n.int32();break;case 13:i.btwo=n.int32();break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,n),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.pone&&!e.isString(n.pone))return"pone: string expected";if(void 0!==n.pthree&&!e.isString(n.pthree))return"pthree: string expected";if(void 0!==n.rone&&null!==n.rone){var r=t[2].verify(n.rone);if(r)return"rone."+r}if(void 0!==n.rtwo&&!e.isString(n.rtwo))return"rtwo: string expected";if(void 0!==n.normalField&&"boolean"!=typeof n.normalField)return"normalField: boolean expected";if(void 0!==n.repeatedField){if(!Array.isArray(n.repeatedField))return"repeatedField: array expected";for(var o=0;o>>3){case 1:o.value=t.int32();break;case 2:o.data=t.bytes();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return void 0===t.value||e.isInteger(t.value)?void 0===t.data||t.data&&"number"==typeof t.data.length||e.isString(t.data)?null:"data: buffer expected":"value: integer expected"}}($protobuf.util),e.fromObject=function(e){return function(t){var n=new $root.jspb.test.TestEndsWithBytes;return void 0!==t.value&&null!==t.value&&(n.value=0|t.value),void 0!==t.data&&null!==t.data&&("string"==typeof t.data?e.base64.decode(t.data,n.data=e.newBuffer(e.base64.length(t.data)),0):t.data&&t.data.length&&(n.data=t.data)),n}}($protobuf.util),e.from=e.fromObject,e.toObject=function(e){return function(t,n){n||(n={});var r={};n.defaults&&(r.value=0,r.data=n.bytes===String?"":[]);for(var o=Object.keys(t),i=0;i>>3){case 1:r.skip().pos++,a.mapStringString===t.emptyObject&&(a.mapStringString={});var s=r.string();r.pos++,a.mapStringString["object"==typeof s?t.longToHash(s):s]=r.string();break;case 2:r.skip().pos++,a.mapStringInt32===t.emptyObject&&(a.mapStringInt32={});var s=r.string();r.pos++,a.mapStringInt32["object"==typeof s?t.longToHash(s):s]=r.int32();break;case 3:r.skip().pos++,a.mapStringInt64===t.emptyObject&&(a.mapStringInt64={});var s=r.string();r.pos++,a.mapStringInt64["object"==typeof s?t.longToHash(s):s]=r.int64();break;case 4:r.skip().pos++,a.mapStringBool===t.emptyObject&&(a.mapStringBool={});var s=r.string();r.pos++,a.mapStringBool["object"==typeof s?t.longToHash(s):s]=r.bool();break;case 5:r.skip().pos++,a.mapStringDouble===t.emptyObject&&(a.mapStringDouble={});var s=r.string();r.pos++,a.mapStringDouble["object"==typeof s?t.longToHash(s):s]=r.double();break;case 6:r.skip().pos++,a.mapStringEnum===t.emptyObject&&(a.mapStringEnum={});var s=r.string();r.pos++,a.mapStringEnum["object"==typeof s?t.longToHash(s):s]=r.uint32();break;case 7:r.skip().pos++,a.mapStringMsg===t.emptyObject&&(a.mapStringMsg={});var s=r.string();r.pos++,a.mapStringMsg["object"==typeof s?t.longToHash(s):s]=n[6].decode(r,r.uint32());break;case 8:r.skip().pos++,a.mapInt32String===t.emptyObject&&(a.mapInt32String={});var s=r.int32();r.pos++,a.mapInt32String["object"==typeof s?t.longToHash(s):s]=r.string();break;case 9:r.skip().pos++,a.mapInt64String===t.emptyObject&&(a.mapInt64String={});var s=r.int64();r.pos++,a.mapInt64String["object"==typeof s?t.longToHash(s):s]=r.string();break;case 10:r.skip().pos++,a.mapBoolString===t.emptyObject&&(a.mapBoolString={});var s=r.bool();r.pos++,a.mapBoolString["object"==typeof s?t.longToHash(s):s]=r.string();break;case 11:a.testMapFields=n[10].decode(r,r.uint32());break;case 12:r.skip().pos++,a.mapStringTestmapfields===t.emptyObject&&(a.mapStringTestmapfields={});var s=r.string();r.pos++,a.mapStringTestmapfields["object"==typeof s?t.longToHash(s):s]=n[11].decode(r,r.uint32());break;default:r.skipType(7&u)}}return a}}($protobuf.Reader,$protobuf.util,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.mapStringString){if(!e.isObject(n.mapStringString))return"mapStringString: object expected";for(var r=Object.keys(n.mapStringString),o=0;o>>3){case 1:o.foo=t.int32();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return void 0===t.foo||e.isInteger(t.foo)?null:"foo: integer expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.jspb.test.MapValueMessageNoBinary;return void 0!==e.foo&&null!==e.foo&&(t.foo=0|e.foo),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.foo=0);for(var r=Object.keys(e),o=0;o>>3){default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(){return null},e.fromObject=function(){return new $root.jspb.test.Deeply},e.from=e.fromObject,e.toObject=function(){return{}},e.prototype.toObject=function(e){return this.constructor.toObject(this,e)},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e.Nested=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(){return null},e.fromObject=function(){return new $root.jspb.test.Deeply.Nested},e.from=e.fromObject,e.toObject=function(){return{}},e.prototype.toObject=function(e){return this.constructor.toObject(this,e)},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e.Message=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:o.count=t.int32();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return void 0===t.count||e.isInteger(t.count)?null:"count: integer expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.jspb.test.Deeply.Nested.Message;return void 0!==e.count&&null!==e.count&&(t.count=0|e.count),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.count=0);for(var r=Object.keys(e),o=0;o>>3){case 1:i.file&&i.file.length||(i.file=[]),i.file.push(t[0].decode(n,n.uint32()));break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(void 0!==t.file){if(!Array.isArray(t.file))return"file: array expected";for(var n=0;n>>3){case 1:i.name=n.string();break;case 2:i.package=n.string();break;case 3:i.dependency&&i.dependency.length||(i.dependency=[]),i.dependency.push(n.string());break;case 10:if(i.publicDependency&&i.publicDependency.length||(i.publicDependency=[]),2===(7&a))for(var u=n.uint32()+n.pos;n.pos>>3){case 1:i.name=n.string();break;case 2:i.field&&i.field.length||(i.field=[]),i.field.push(t[1].decode(n,n.uint32()));break;case 6:i.extension&&i.extension.length||(i.extension=[]),i.extension.push(t[2].decode(n,n.uint32()));break;case 3:i.nestedType&&i.nestedType.length||(i.nestedType=[]),i.nestedType.push(t[3].decode(n,n.uint32()));break;case 4:i.enumType&&i.enumType.length||(i.enumType=[]),i.enumType.push(t[4].decode(n,n.uint32()));break;case 5:i.extensionRange&&i.extensionRange.length||(i.extensionRange=[]),i.extensionRange.push(t[5].decode(n,n.uint32()));break;case 8:i.oneofDecl&&i.oneofDecl.length||(i.oneofDecl=[]),i.oneofDecl.push(t[6].decode(n,n.uint32()));break;case 7:i.options=t[7].decode(n,n.uint32());break;case 9:i.reservedRange&&i.reservedRange.length||(i.reservedRange=[]),i.reservedRange.push(t[8].decode(n,n.uint32()));break;case 10:i.reservedName&&i.reservedName.length||(i.reservedName=[]),i.reservedName.push(n.string());break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.name&&!e.isString(n.name))return"name: string expected";if(void 0!==n.field){if(!Array.isArray(n.field))return"field: array expected";for(var r=0;r>>3){case 1:o.start=t.int32();break;case 2:o.end=t.int32();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return void 0===t.start||e.isInteger(t.start)?void 0===t.end||e.isInteger(t.end)?null:"end: integer expected":"start: integer expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.google.protobuf.DescriptorProto.ExtensionRange;return void 0!==e.start&&null!==e.start&&(t.start=0|e.start),void 0!==e.end&&null!==e.end&&(t.end=0|e.end),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.start=0,n.end=0);for(var r=Object.keys(e),o=0;o>>3){case 1:o.start=t.int32();break;case 2:o.end=t.int32();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return void 0===t.start||e.isInteger(t.start)?void 0===t.end||e.isInteger(t.end)?null:"end: integer expected":"start: integer expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.google.protobuf.DescriptorProto.ReservedRange;return void 0!==e.start&&null!==e.start&&(t.start=0|e.start),void 0!==e.end&&null!==e.end&&(t.end=0|e.end),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.start=0,n.end=0);for(var r=Object.keys(e),o=0;o>>3){case 1:i.name=n.string();break;case 3:i.number=n.int32();break;case 4:i.label=n.uint32();break;case 5:i.type=n.uint32();break;case 6:i.typeName=n.string();break;case 2:i.extendee=n.string();break;case 7:i.defaultValue=n.string();break;case 9:i.oneofIndex=n.int32();break;case 10:i.jsonName=n.string();break;case 8:i.options=t[9].decode(n,n.uint32());break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.name&&!e.isString(n.name))return"name: string expected";if(void 0!==n.number&&!e.isInteger(n.number))return"number: integer expected";if(void 0!==n.label)switch(n.label){default:return"label: enum value expected";case 1:case 2:case 3:}if(void 0!==n.type)switch(n.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:}if(void 0!==n.typeName&&!e.isString(n.typeName))return"typeName: string expected";if(void 0!==n.extendee&&!e.isString(n.extendee))return"extendee: string expected";if(void 0!==n.defaultValue&&!e.isString(n.defaultValue))return"defaultValue: string expected";if(void 0!==n.oneofIndex&&!e.isInteger(n.oneofIndex))return"oneofIndex: integer expected";if(void 0!==n.jsonName&&!e.isString(n.jsonName))return"jsonName: string expected";if(void 0!==n.options&&null!==n.options){var r=t[9].verify(n.options);if(r)return"options."+r}return null}}($protobuf.util,t),e.fromObject=function(e){return function(t){var n=new $root.google.protobuf.FieldDescriptorProto;switch(void 0!==t.name&&null!==t.name&&(n.name=String(t.name)),void 0!==t.number&&null!==t.number&&(n.number=0|t.number),t.label){case"LABEL_OPTIONAL":case 1:n.label=1;break;case"LABEL_REQUIRED":case 2:n.label=2;break;case"LABEL_REPEATED":case 3:n.label=3}switch(t.type){case"TYPE_DOUBLE":case 1:n.type=1;break;case"TYPE_FLOAT":case 2:n.type=2;break;case"TYPE_INT64":case 3:n.type=3;break;case"TYPE_UINT64":case 4:n.type=4;break;case"TYPE_INT32":case 5:n.type=5;break;case"TYPE_FIXED64":case 6:n.type=6;break;case"TYPE_FIXED32":case 7:n.type=7;break;case"TYPE_BOOL":case 8:n.type=8;break;case"TYPE_STRING":case 9:n.type=9;break;case"TYPE_GROUP":case 10:n.type=10;break;case"TYPE_MESSAGE":case 11:n.type=11;break;case"TYPE_BYTES":case 12:n.type=12;break;case"TYPE_UINT32":case 13:n.type=13;break;case"TYPE_ENUM":case 14:n.type=14;break;case"TYPE_SFIXED32":case 15:n.type=15;break;case"TYPE_SFIXED64":case 16:n.type=16;break;case"TYPE_SINT32":case 17:n.type=17;break;case"TYPE_SINT64":case 18:n.type=18}return void 0!==t.typeName&&null!==t.typeName&&(n.typeName=String(t.typeName)),void 0!==t.extendee&&null!==t.extendee&&(n.extendee=String(t.extendee)),void 0!==t.defaultValue&&null!==t.defaultValue&&(n.defaultValue=String(t.defaultValue)),void 0!==t.oneofIndex&&null!==t.oneofIndex&&(n.oneofIndex=0|t.oneofIndex),void 0!==t.jsonName&&null!==t.jsonName&&(n.jsonName=String(t.jsonName)),void 0!==t.options&&null!==t.options&&(n.options=e[9].fromObject(t.options)),n}}(t),e.from=e.fromObject,e.toObject=function(e){return function(t,n){n||(n={});var r={};n.defaults&&(r.name="",r.number=0,r.label=n.enums===String?"LABEL_OPTIONAL":1,r.type=n.enums===String?"TYPE_DOUBLE":1,r.typeName="",r.extendee="",r.defaultValue="",r.oneofIndex=0,r.jsonName="",r.options=null);for(var o=Object.keys(t),i=0;i>>3){case 1:i.name=n.string();break;case 2:i.options=t[1].decode(n,n.uint32());break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.name&&!e.isString(n.name))return"name: string expected";if(void 0!==n.options&&null!==n.options){var r=t[1].verify(n.options);if(r)return"options."+r}return null}}($protobuf.util,t),e.fromObject=function(e){return function(t){var n=new $root.google.protobuf.OneofDescriptorProto;return void 0!==t.name&&null!==t.name&&(n.name=String(t.name)),void 0!==t.options&&null!==t.options&&(n.options=e[1].fromObject(t.options)),n}}(t),e.from=e.fromObject,e.toObject=function(e){return function(t,n){n||(n={});var r={};n.defaults&&(r.name="",r.options=null);for(var o=Object.keys(t),i=0;i>>3){case 1:i.name=n.string();break;case 2:i.value&&i.value.length||(i.value=[]),i.value.push(t[1].decode(n,n.uint32()));break;case 3:i.options=t[2].decode(n,n.uint32());break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.name&&!e.isString(n.name))return"name: string expected";if(void 0!==n.value){if(!Array.isArray(n.value))return"value: array expected";for(var r=0;r>>3){case 1:i.name=n.string();break;case 2:i.number=n.int32();break;case 3:i.options=t[2].decode(n,n.uint32());break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.name&&!e.isString(n.name))return"name: string expected";if(void 0!==n.number&&!e.isInteger(n.number))return"number: integer expected";if(void 0!==n.options&&null!==n.options){var r=t[2].verify(n.options);if(r)return"options."+r}return null}}($protobuf.util,t),e.fromObject=function(e){return function(t){var n=new $root.google.protobuf.EnumValueDescriptorProto;return void 0!==t.name&&null!==t.name&&(n.name=String(t.name)),void 0!==t.number&&null!==t.number&&(n.number=0|t.number),void 0!==t.options&&null!==t.options&&(n.options=e[2].fromObject(t.options)),n}}(t),e.from=e.fromObject,e.toObject=function(e){return function(t,n){n||(n={});var r={};n.defaults&&(r.name="",r.number=0,r.options=null);for(var o=Object.keys(t),i=0;i>>3){case 1:i.name=n.string();break;case 2:i.method&&i.method.length||(i.method=[]),i.method.push(t[1].decode(n,n.uint32()));break;case 3:i.options=t[2].decode(n,n.uint32());break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.name&&!e.isString(n.name))return"name: string expected";if(void 0!==n.method){if(!Array.isArray(n.method))return"method: array expected";for(var r=0;r>>3){case 1:i.name=n.string();break;case 2:i.inputType=n.string();break;case 3:i.outputType=n.string();break;case 4:i.options=t[3].decode(n,n.uint32());break;case 5:i.clientStreaming=n.bool();break;case 6:i.serverStreaming=n.bool();break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.name&&!e.isString(n.name))return"name: string expected";if(void 0!==n.inputType&&!e.isString(n.inputType))return"inputType: string expected";if(void 0!==n.outputType&&!e.isString(n.outputType))return"outputType: string expected";if(void 0!==n.options&&null!==n.options){var r=t[3].verify(n.options);if(r)return"options."+r}return void 0!==n.clientStreaming&&"boolean"!=typeof n.clientStreaming?"clientStreaming: boolean expected":void 0!==n.serverStreaming&&"boolean"!=typeof n.serverStreaming?"serverStreaming: boolean expected":null}}($protobuf.util,t),e.fromObject=function(e){return function(t){var n=new $root.google.protobuf.MethodDescriptorProto;return void 0!==t.name&&null!==t.name&&(n.name=String(t.name)),void 0!==t.inputType&&null!==t.inputType&&(n.inputType=String(t.inputType)),void 0!==t.outputType&&null!==t.outputType&&(n.outputType=String(t.outputType)),void 0!==t.options&&null!==t.options&&(n.options=e[3].fromObject(t.options)),void 0!==t.clientStreaming&&null!==t.clientStreaming&&(n.clientStreaming=Boolean(t.clientStreaming)),void 0!==t.serverStreaming&&null!==t.serverStreaming&&(n.serverStreaming=Boolean(t.serverStreaming)),n}}(t),e.from=e.fromObject,e.toObject=function(e){return function(t,n){n||(n={});var r={};n.defaults&&(r.name="",r.inputType="",r.outputType="",r.options=null,r.clientStreaming=!1,r.serverStreaming=!1);for(var o=Object.keys(t),i=0;i>>3){case 1:i.javaPackage=n.string();break;case 8:i.javaOuterClassname=n.string();break;case 10:i.javaMultipleFiles=n.bool();break;case 20:i.javaGenerateEqualsAndHash=n.bool();break;case 27:i.javaStringCheckUtf8=n.bool();break;case 9:i.optimizeFor=n.uint32();break;case 11:i.goPackage=n.string();break;case 16:i.ccGenericServices=n.bool();break;case 17:i.javaGenericServices=n.bool();break;case 18:i.pyGenericServices=n.bool();break;case 23:i.deprecated=n.bool();break;case 31:i.ccEnableArenas=n.bool();break;case 36:i.objcClassPrefix=n.string();break;case 37:i.csharpNamespace=n.string();break;case 999:i.uninterpretedOption&&i.uninterpretedOption.length||(i.uninterpretedOption=[]),i.uninterpretedOption.push(t[14].decode(n,n.uint32()));break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.javaPackage&&!e.isString(n.javaPackage))return"javaPackage: string expected";if(void 0!==n.javaOuterClassname&&!e.isString(n.javaOuterClassname))return"javaOuterClassname: string expected";if(void 0!==n.javaMultipleFiles&&"boolean"!=typeof n.javaMultipleFiles)return"javaMultipleFiles: boolean expected";if(void 0!==n.javaGenerateEqualsAndHash&&"boolean"!=typeof n.javaGenerateEqualsAndHash)return"javaGenerateEqualsAndHash: boolean expected";if(void 0!==n.javaStringCheckUtf8&&"boolean"!=typeof n.javaStringCheckUtf8)return"javaStringCheckUtf8: boolean expected";if(void 0!==n.optimizeFor)switch(n.optimizeFor){default:return"optimizeFor: enum value expected";case 1:case 2:case 3:}if(void 0!==n.goPackage&&!e.isString(n.goPackage))return"goPackage: string expected";if(void 0!==n.ccGenericServices&&"boolean"!=typeof n.ccGenericServices)return"ccGenericServices: boolean expected";if(void 0!==n.javaGenericServices&&"boolean"!=typeof n.javaGenericServices)return"javaGenericServices: boolean expected";if(void 0!==n.pyGenericServices&&"boolean"!=typeof n.pyGenericServices)return"pyGenericServices: boolean expected";if(void 0!==n.deprecated&&"boolean"!=typeof n.deprecated)return"deprecated: boolean expected";if(void 0!==n.ccEnableArenas&&"boolean"!=typeof n.ccEnableArenas)return"ccEnableArenas: boolean expected";if(void 0!==n.objcClassPrefix&&!e.isString(n.objcClassPrefix))return"objcClassPrefix: string expected";if(void 0!==n.csharpNamespace&&!e.isString(n.csharpNamespace))return"csharpNamespace: string expected";if(void 0!==n.uninterpretedOption){if(!Array.isArray(n.uninterpretedOption))return"uninterpretedOption: array expected";for(var r=0;r>>3){case 1:i.messageSetWireFormat=n.bool();break;case 2:i.noStandardDescriptorAccessor=n.bool();break;case 3:i.deprecated=n.bool();break;case 7:i.mapEntry=n.bool();break;case 999:i.uninterpretedOption&&i.uninterpretedOption.length||(i.uninterpretedOption=[]),i.uninterpretedOption.push(t[4].decode(n,n.uint32()));break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(void 0!==t.messageSetWireFormat&&"boolean"!=typeof t.messageSetWireFormat)return"messageSetWireFormat: boolean expected";if(void 0!==t.noStandardDescriptorAccessor&&"boolean"!=typeof t.noStandardDescriptorAccessor)return"noStandardDescriptorAccessor: boolean expected";if(void 0!==t.deprecated&&"boolean"!=typeof t.deprecated)return"deprecated: boolean expected";if(void 0!==t.mapEntry&&"boolean"!=typeof t.mapEntry)return"mapEntry: boolean expected";if(void 0!==t.uninterpretedOption){if(!Array.isArray(t.uninterpretedOption))return"uninterpretedOption: array expected";for(var n=0;n>>3){case 1:i.ctype=n.uint32();break;case 2:i.packed=n.bool();break;case 6:i.jstype=n.uint32();break;case 5:i.lazy=n.bool();break;case 3:i.deprecated=n.bool();break;case 10:i.weak=n.bool();break;case 999:i.uninterpretedOption&&i.uninterpretedOption.length||(i.uninterpretedOption=[]),i.uninterpretedOption.push(t[6].decode(n,n.uint32()));break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(void 0!==t.ctype)switch(t.ctype){default:return"ctype: enum value expected";case 0:case 1:case 2:}if(void 0!==t.packed&&"boolean"!=typeof t.packed)return"packed: boolean expected";if(void 0!==t.jstype)switch(t.jstype){default:return"jstype: enum value expected";case 0:case 1:case 2:}if(void 0!==t.lazy&&"boolean"!=typeof t.lazy)return"lazy: boolean expected";if(void 0!==t.deprecated&&"boolean"!=typeof t.deprecated)return"deprecated: boolean expected";if(void 0!==t.weak&&"boolean"!=typeof t.weak)return"weak: boolean expected";if(void 0!==t.uninterpretedOption){if(!Array.isArray(t.uninterpretedOption))return"uninterpretedOption: array expected";for(var n=0;n>>3){case 999:i.uninterpretedOption&&i.uninterpretedOption.length||(i.uninterpretedOption=[]),i.uninterpretedOption.push(t[0].decode(n,n.uint32()));break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(void 0!==t.uninterpretedOption){if(!Array.isArray(t.uninterpretedOption))return"uninterpretedOption: array expected"; +for(var n=0;n>>3){case 2:i.allowAlias=n.bool();break;case 3:i.deprecated=n.bool();break;case 999:i.uninterpretedOption&&i.uninterpretedOption.length||(i.uninterpretedOption=[]),i.uninterpretedOption.push(t[2].decode(n,n.uint32()));break;case 42113038:i[".jspb.test.IsExtension.simpleOption"]=n.string();break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.allowAlias&&"boolean"!=typeof n.allowAlias)return"allowAlias: boolean expected";if(void 0!==n.deprecated&&"boolean"!=typeof n.deprecated)return"deprecated: boolean expected";if(void 0!==n.uninterpretedOption){if(!Array.isArray(n.uninterpretedOption))return"uninterpretedOption: array expected";for(var r=0;r>>3){case 1:i.deprecated=n.bool();break;case 999:i.uninterpretedOption&&i.uninterpretedOption.length||(i.uninterpretedOption=[]),i.uninterpretedOption.push(t[1].decode(n,n.uint32()));break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(void 0!==t.deprecated&&"boolean"!=typeof t.deprecated)return"deprecated: boolean expected";if(void 0!==t.uninterpretedOption){if(!Array.isArray(t.uninterpretedOption))return"uninterpretedOption: array expected";for(var n=0;n>>3){case 33:i.deprecated=n.bool();break;case 999:i.uninterpretedOption&&i.uninterpretedOption.length||(i.uninterpretedOption=[]),i.uninterpretedOption.push(t[1].decode(n,n.uint32()));break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(void 0!==t.deprecated&&"boolean"!=typeof t.deprecated)return"deprecated: boolean expected";if(void 0!==t.uninterpretedOption){if(!Array.isArray(t.uninterpretedOption))return"uninterpretedOption: array expected";for(var n=0;n>>3){case 33:i.deprecated=n.bool();break;case 34:i.idempotencyLevel=n.uint32();break;case 999:i.uninterpretedOption&&i.uninterpretedOption.length||(i.uninterpretedOption=[]),i.uninterpretedOption.push(t[2].decode(n,n.uint32()));break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(void 0!==t.deprecated&&"boolean"!=typeof t.deprecated)return"deprecated: boolean expected";if(void 0!==t.idempotencyLevel)switch(t.idempotencyLevel){default:return"idempotencyLevel: enum value expected";case 0:case 1:case 2:}if(void 0!==t.uninterpretedOption){if(!Array.isArray(t.uninterpretedOption))return"uninterpretedOption: array expected";for(var n=0;n>>3){case 2:i.name&&i.name.length||(i.name=[]),i.name.push(t[0].decode(n,n.uint32()));break;case 3:i.identifierValue=n.string();break;case 4:i.positiveIntValue=n.uint64();break;case 5:i.negativeIntValue=n.int64();break;case 6:i.doubleValue=n.double();break;case 7:i.stringValue=n.bytes();break;case 8:i.aggregateValue=n.string();break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e,t){return function(n){if(void 0!==n.name){if(!Array.isArray(n.name))return"name: array expected";for(var r=0;r>>3){case 1:o.namePart=t.string();break;case 2:o.isExtension=t.bool();break;default:t.skipType(7&i)}}return o}}($protobuf.Reader),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){return e.isString(t.namePart)?"boolean"!=typeof t.isExtension?"isExtension: boolean expected":null:"namePart: string expected"}}($protobuf.util),e.fromObject=function(e){var t=new $root.google.protobuf.UninterpretedOption.NamePart;return void 0!==e.namePart&&null!==e.namePart&&(t.namePart=String(e.namePart)),void 0!==e.isExtension&&null!==e.isExtension&&(t.isExtension=Boolean(e.isExtension)),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.namePart="",n.isExtension=!1);for(var r=Object.keys(e),o=0;o>>3){case 1:i.location&&i.location.length||(i.location=[]),i.location.push(t[0].decode(n,n.uint32()));break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(void 0!==t.location){if(!Array.isArray(t.location))return"location: array expected";for(var n=0;n>>3){case 1:if(o.path&&o.path.length||(o.path=[]),2===(7&i))for(var a=t.uint32()+t.pos;t.pos>>3){case 1:i.annotation&&i.annotation.length||(i.annotation=[]),i.annotation.push(t[0].decode(n,n.uint32()));break;default:n.skipType(7&a)}}return i}}($protobuf.Reader,t),e.decodeDelimited=function(e){return e=e instanceof $protobuf.Reader?e:$protobuf.Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return function(t){if(void 0!==t.annotation){if(!Array.isArray(t.annotation))return"annotation: array expected";for(var n=0;n>>3){case 1:if(o.path&&o.path.length||(o.path=[]),2===(7&i))for(var a=t.uint32()+t.pos;t.pos