protobufjs 7.5.5 → 7.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/light/protobuf.js +230 -108
- package/dist/light/protobuf.js.map +1 -1
- package/dist/light/protobuf.min.js +3 -3
- package/dist/light/protobuf.min.js.map +1 -1
- package/dist/minimal/protobuf.js +90 -38
- package/dist/minimal/protobuf.js.map +1 -1
- package/dist/minimal/protobuf.min.js +3 -3
- package/dist/minimal/protobuf.min.js.map +1 -1
- package/dist/protobuf.js +234 -111
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/ext/descriptor/index.d.ts +4 -0
- package/ext/descriptor/index.js +35 -16
- package/index.d.ts +22 -4
- package/package.json +7 -4
- package/src/converter.js +14 -5
- package/src/decoder.js +17 -9
- package/src/enum.js +4 -1
- package/src/namespace.js +10 -6
- package/src/object.js +4 -0
- package/src/parse.js +4 -3
- package/src/reader.js +12 -2
- package/src/service.js +8 -4
- package/src/type.js +22 -12
- package/src/types.js +1 -1
- package/src/util/minimal.js +24 -1
- package/src/util/patterns.js +8 -0
- package/src/util.js +9 -9
- package/src/verifier.js +7 -4
- package/src/wrappers.js +4 -3
package/dist/light/protobuf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js v7.5.
|
|
3
|
-
* compiled
|
|
2
|
+
* protobuf.js v7.5.6 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled tue, 28 apr 2026 00:45:19 utc
|
|
4
4
|
* licensed under the bsd-3-clause license
|
|
5
5
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
6
6
|
*/
|
|
@@ -236,6 +236,8 @@ base64.test = function test(string) {
|
|
|
236
236
|
"use strict";
|
|
237
237
|
module.exports = codegen;
|
|
238
238
|
|
|
239
|
+
var reservedRe = /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;
|
|
240
|
+
|
|
239
241
|
/**
|
|
240
242
|
* Begins generating a function.
|
|
241
243
|
* @memberof util
|
|
@@ -310,7 +312,7 @@ function codegen(functionParams, functionName) {
|
|
|
310
312
|
}
|
|
311
313
|
|
|
312
314
|
function toString(functionNameOverride) {
|
|
313
|
-
return "function " + (functionNameOverride || functionName
|
|
315
|
+
return "function " + safeFunctionName(functionNameOverride || functionName) + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}";
|
|
314
316
|
}
|
|
315
317
|
|
|
316
318
|
Codegen.toString = toString;
|
|
@@ -332,6 +334,17 @@ function codegen(functionParams, functionName) {
|
|
|
332
334
|
* @type {boolean}
|
|
333
335
|
*/
|
|
334
336
|
codegen.verbose = false;
|
|
337
|
+
|
|
338
|
+
function safeFunctionName(name) {
|
|
339
|
+
if (!name)
|
|
340
|
+
return "";
|
|
341
|
+
name = String(name).replace(/[^\w$]/g, "");
|
|
342
|
+
if (!name)
|
|
343
|
+
return "";
|
|
344
|
+
if (/^\d/.test(name))
|
|
345
|
+
name = "_" + name;
|
|
346
|
+
return reservedRe.test(name) ? name + "_" : name;
|
|
347
|
+
}
|
|
335
348
|
|
|
336
349
|
},{}],4:[function(require,module,exports){
|
|
337
350
|
"use strict";
|
|
@@ -876,13 +889,33 @@ module.exports = inquire;
|
|
|
876
889
|
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
|
877
890
|
*/
|
|
878
891
|
function inquire(moduleName) {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
892
|
+
try {
|
|
893
|
+
if (typeof require !== "function") {
|
|
894
|
+
return null;
|
|
895
|
+
}
|
|
896
|
+
var mod = require(moduleName);
|
|
897
|
+
if (mod && (mod.length || Object.keys(mod).length)) return mod;
|
|
898
|
+
return null;
|
|
899
|
+
} catch (err) {
|
|
900
|
+
// ignore
|
|
884
901
|
return null;
|
|
902
|
+
}
|
|
885
903
|
}
|
|
904
|
+
|
|
905
|
+
/*
|
|
906
|
+
// maybe worth a shot to prevent renaming issues:
|
|
907
|
+
// see: https://github.com/webpack/webpack/blob/master/lib/dependencies/CommonJsRequireDependencyParserPlugin.js
|
|
908
|
+
// triggers on:
|
|
909
|
+
// - expression require.cache
|
|
910
|
+
// - expression require (???)
|
|
911
|
+
// - call require
|
|
912
|
+
// - call require:commonjs:item
|
|
913
|
+
// - call require:commonjs:context
|
|
914
|
+
|
|
915
|
+
Object.defineProperty(Function.prototype, "__self", { get: function() { return this; } });
|
|
916
|
+
var r = require.__self;
|
|
917
|
+
delete Function.prototype.__self;
|
|
918
|
+
*/
|
|
886
919
|
|
|
887
920
|
},{}],8:[function(require,module,exports){
|
|
888
921
|
"use strict";
|
|
@@ -1009,7 +1042,8 @@ function pool(alloc, slice, size) {
|
|
|
1009
1042
|
* @memberof util
|
|
1010
1043
|
* @namespace
|
|
1011
1044
|
*/
|
|
1012
|
-
var utf8 = exports
|
|
1045
|
+
var utf8 = exports,
|
|
1046
|
+
replacementChar = "\ufffd";
|
|
1013
1047
|
|
|
1014
1048
|
/**
|
|
1015
1049
|
* Calculates the UTF8 byte length of a string.
|
|
@@ -1042,36 +1076,34 @@ utf8.length = function utf8_length(string) {
|
|
|
1042
1076
|
* @returns {string} String read
|
|
1043
1077
|
*/
|
|
1044
1078
|
utf8.read = function utf8_read(buffer, start, end) {
|
|
1045
|
-
|
|
1046
|
-
if (len < 1)
|
|
1079
|
+
if (end - start < 1) {
|
|
1047
1080
|
return "";
|
|
1048
|
-
var parts = null,
|
|
1049
|
-
chunk = [],
|
|
1050
|
-
i = 0, // char offset
|
|
1051
|
-
t; // temporary
|
|
1052
|
-
while (start < end) {
|
|
1053
|
-
t = buffer[start++];
|
|
1054
|
-
if (t < 128)
|
|
1055
|
-
chunk[i++] = t;
|
|
1056
|
-
else if (t > 191 && t < 224)
|
|
1057
|
-
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
1058
|
-
else if (t > 239 && t < 365) {
|
|
1059
|
-
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
1060
|
-
chunk[i++] = 0xD800 + (t >> 10);
|
|
1061
|
-
chunk[i++] = 0xDC00 + (t & 1023);
|
|
1062
|
-
} else
|
|
1063
|
-
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
1064
|
-
if (i > 8191) {
|
|
1065
|
-
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
1066
|
-
i = 0;
|
|
1067
|
-
}
|
|
1068
1081
|
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1082
|
+
|
|
1083
|
+
var str = "";
|
|
1084
|
+
for (var i = start; i < end;) {
|
|
1085
|
+
var t = buffer[i++];
|
|
1086
|
+
if (t <= 0x7F) {
|
|
1087
|
+
str += String.fromCharCode(t);
|
|
1088
|
+
} else if (t >= 0xC0 && t < 0xE0) {
|
|
1089
|
+
var c2 = (t & 0x1F) << 6 | buffer[i++] & 0x3F;
|
|
1090
|
+
str += c2 >= 0x80 ? String.fromCharCode(c2) : replacementChar;
|
|
1091
|
+
} else if (t >= 0xE0 && t < 0xF0) {
|
|
1092
|
+
var c3 = (t & 0xF) << 12 | (buffer[i++] & 0x3F) << 6 | buffer[i++] & 0x3F;
|
|
1093
|
+
str += c3 >= 0x800 ? String.fromCharCode(c3) : replacementChar;
|
|
1094
|
+
} else if (t >= 0xF0) {
|
|
1095
|
+
var t2 = (t & 7) << 18 | (buffer[i++] & 0x3F) << 12 | (buffer[i++] & 0x3F) << 6 | buffer[i++] & 0x3F;
|
|
1096
|
+
if (t2 < 0x10000 || t2 > 0x10FFFF)
|
|
1097
|
+
str += replacementChar;
|
|
1098
|
+
else {
|
|
1099
|
+
t2 -= 0x10000;
|
|
1100
|
+
str += String.fromCharCode(0xD800 + (t2 >> 10));
|
|
1101
|
+
str += String.fromCharCode(0xDC00 + (t2 & 0x3FF));
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1073
1104
|
}
|
|
1074
|
-
|
|
1105
|
+
|
|
1106
|
+
return str;
|
|
1075
1107
|
};
|
|
1076
1108
|
|
|
1077
1109
|
/**
|
|
@@ -1154,7 +1186,7 @@ function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
|
|
|
1154
1186
|
} else gen
|
|
1155
1187
|
("if(typeof d%s!==\"object\")", prop)
|
|
1156
1188
|
("throw TypeError(%j)", field.fullName + ": object expected")
|
|
1157
|
-
("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop);
|
|
1189
|
+
("m%s=types[%i].fromObject(d%s,n+1)", prop, fieldIndex, prop);
|
|
1158
1190
|
} else {
|
|
1159
1191
|
var isUnsigned = false;
|
|
1160
1192
|
switch (field.type) {
|
|
@@ -1216,9 +1248,12 @@ function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
|
|
|
1216
1248
|
converter.fromObject = function fromObject(mtype) {
|
|
1217
1249
|
/* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */
|
|
1218
1250
|
var fields = mtype.fieldsArray;
|
|
1219
|
-
var gen = util.codegen(["d"], mtype.name + "$fromObject")
|
|
1251
|
+
var gen = util.codegen(["d", "n"], mtype.name + "$fromObject")
|
|
1220
1252
|
("if(d instanceof this.ctor)")
|
|
1221
|
-
("return d")
|
|
1253
|
+
("return d")
|
|
1254
|
+
("if(n===undefined)n=0")
|
|
1255
|
+
("if(n>util.recursionLimit)")
|
|
1256
|
+
("throw Error(\"maximum nesting depth exceeded\")");
|
|
1222
1257
|
if (!fields.length) return gen
|
|
1223
1258
|
("return new this.ctor");
|
|
1224
1259
|
gen
|
|
@@ -1234,6 +1269,9 @@ converter.fromObject = function fromObject(mtype) {
|
|
|
1234
1269
|
("throw TypeError(%j)", field.fullName + ": object expected")
|
|
1235
1270
|
("m%s={}", prop)
|
|
1236
1271
|
("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){", prop);
|
|
1272
|
+
gen
|
|
1273
|
+
("if(ks[i]===\"__proto__\")")
|
|
1274
|
+
("util.makeProp(m%s,ks[i])", prop);
|
|
1237
1275
|
genValuePartial_fromObject(gen, field, /* not sorted */ i, prop + "[ks[i]]")
|
|
1238
1276
|
("}")
|
|
1239
1277
|
("}");
|
|
@@ -1364,11 +1402,11 @@ converter.toObject = function toObject(mtype) {
|
|
|
1364
1402
|
("}else")
|
|
1365
1403
|
("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber());
|
|
1366
1404
|
else if (field.bytes) {
|
|
1367
|
-
var arrayDefault =
|
|
1405
|
+
var arrayDefault = Array.prototype.slice.call(field.typeDefault);
|
|
1368
1406
|
gen
|
|
1369
1407
|
("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault))
|
|
1370
1408
|
("else{")
|
|
1371
|
-
("d%s=%
|
|
1409
|
+
("d%s=%j", prop, arrayDefault)
|
|
1372
1410
|
("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop)
|
|
1373
1411
|
("}");
|
|
1374
1412
|
} else gen
|
|
@@ -1388,6 +1426,9 @@ converter.toObject = function toObject(mtype) {
|
|
|
1388
1426
|
("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop)
|
|
1389
1427
|
("d%s={}", prop)
|
|
1390
1428
|
("for(var j=0;j<ks2.length;++j){");
|
|
1429
|
+
gen
|
|
1430
|
+
("if(ks2[j]===\"__proto__\")")
|
|
1431
|
+
("util.makeProp(d%s,ks2[j])", prop);
|
|
1391
1432
|
genValuePartial_toObject(gen, field, /* sorted */ index, prop + "[ks2[j]]")
|
|
1392
1433
|
("}");
|
|
1393
1434
|
} else if (field.repeated) { gen
|
|
@@ -1430,9 +1471,12 @@ function missing(field) {
|
|
|
1430
1471
|
*/
|
|
1431
1472
|
function decoder(mtype) {
|
|
1432
1473
|
/* eslint-disable no-unexpected-multiline */
|
|
1433
|
-
var gen = util.codegen(["r", "l", "e"], mtype.name + "$decode")
|
|
1474
|
+
var gen = util.codegen(["r", "l", "e", "n"], mtype.name + "$decode")
|
|
1434
1475
|
("if(!(r instanceof Reader))")
|
|
1435
1476
|
("r=Reader.create(r)")
|
|
1477
|
+
("if(n===undefined)n=0")
|
|
1478
|
+
("if(n>Reader.recursionLimit)")
|
|
1479
|
+
("throw Error(\"maximum nesting depth exceeded\")")
|
|
1436
1480
|
("var c=l===undefined?r.len:r.pos+l,m=new this.ctor" + (mtype.fieldsArray.filter(function(field) { return field.map; }).length ? ",k,value" : ""))
|
|
1437
1481
|
("while(r.pos<c){")
|
|
1438
1482
|
("var t=r.uint32()")
|
|
@@ -1471,22 +1515,27 @@ function decoder(mtype) {
|
|
|
1471
1515
|
("case 2:");
|
|
1472
1516
|
|
|
1473
1517
|
if (types.basic[type] === undefined) gen
|
|
1474
|
-
("value=types[%i].decode(r,r.uint32())", i); // can't be groups
|
|
1518
|
+
("value=types[%i].decode(r,r.uint32(),undefined,n+1)", i); // can't be groups
|
|
1475
1519
|
else gen
|
|
1476
1520
|
("value=r.%s()", type);
|
|
1477
1521
|
|
|
1478
1522
|
gen
|
|
1479
1523
|
("break")
|
|
1480
1524
|
("default:")
|
|
1481
|
-
("r.skipType(tag2&7)")
|
|
1525
|
+
("r.skipType(tag2&7,n)")
|
|
1482
1526
|
("break")
|
|
1483
1527
|
("}")
|
|
1484
1528
|
("}");
|
|
1485
1529
|
|
|
1486
1530
|
if (types.long[field.keyType] !== undefined) gen
|
|
1487
1531
|
("%s[typeof k===\"object\"?util.longToHash(k):k]=value", ref);
|
|
1488
|
-
else
|
|
1532
|
+
else {
|
|
1533
|
+
if (field.keyType === "string") gen
|
|
1534
|
+
("if(k===\"__proto__\")")
|
|
1535
|
+
("util.makeProp(%s,k)", ref);
|
|
1536
|
+
gen
|
|
1489
1537
|
("%s[k]=value", ref);
|
|
1538
|
+
}
|
|
1490
1539
|
|
|
1491
1540
|
// Repeated fields
|
|
1492
1541
|
} else if (field.repeated) { gen
|
|
@@ -1504,15 +1553,15 @@ function decoder(mtype) {
|
|
|
1504
1553
|
|
|
1505
1554
|
// Non-packed
|
|
1506
1555
|
if (types.basic[type] === undefined) gen(field.delimited
|
|
1507
|
-
? "%s.push(types[%i].decode(r,undefined,((t&~7)|4)))"
|
|
1508
|
-
: "%s.push(types[%i].decode(r,r.uint32()))", ref, i);
|
|
1556
|
+
? "%s.push(types[%i].decode(r,undefined,((t&~7)|4),n+1))"
|
|
1557
|
+
: "%s.push(types[%i].decode(r,r.uint32(),undefined,n+1))", ref, i);
|
|
1509
1558
|
else gen
|
|
1510
1559
|
("%s.push(r.%s())", ref, type);
|
|
1511
1560
|
|
|
1512
1561
|
// Non-repeated
|
|
1513
1562
|
} else if (types.basic[type] === undefined) gen(field.delimited
|
|
1514
|
-
? "%s=types[%i].decode(r,undefined,((t&~7)|4))"
|
|
1515
|
-
: "%s=types[%i].decode(r,r.uint32())", ref, i);
|
|
1563
|
+
? "%s=types[%i].decode(r,undefined,((t&~7)|4),n+1)"
|
|
1564
|
+
: "%s=types[%i].decode(r,r.uint32(),undefined,n+1)", ref, i);
|
|
1516
1565
|
else gen
|
|
1517
1566
|
("%s=r.%s()", ref, type);
|
|
1518
1567
|
gen
|
|
@@ -1521,7 +1570,7 @@ function decoder(mtype) {
|
|
|
1521
1570
|
// Unknown fields
|
|
1522
1571
|
} gen
|
|
1523
1572
|
("default:")
|
|
1524
|
-
("r.skipType(t&7)")
|
|
1573
|
+
("r.skipType(t&7,n)")
|
|
1525
1574
|
("break")
|
|
1526
1575
|
|
|
1527
1576
|
("}")
|
|
@@ -1719,7 +1768,7 @@ function Enum(name, values, options, comment, comments, valuesOptions) {
|
|
|
1719
1768
|
|
|
1720
1769
|
if (values)
|
|
1721
1770
|
for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)
|
|
1722
|
-
if (typeof values[keys[i]] === "number") // use forward entries only
|
|
1771
|
+
if (keys[i] !== "__proto__" && typeof values[keys[i]] === "number") // use forward entries only
|
|
1723
1772
|
this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];
|
|
1724
1773
|
}
|
|
1725
1774
|
|
|
@@ -1798,6 +1847,9 @@ Enum.prototype.add = function add(name, id, comment, options) {
|
|
|
1798
1847
|
if (!util.isInteger(id))
|
|
1799
1848
|
throw TypeError("id must be an integer");
|
|
1800
1849
|
|
|
1850
|
+
if (name === "__proto__")
|
|
1851
|
+
return this;
|
|
1852
|
+
|
|
1801
1853
|
if (this.values[name] !== undefined)
|
|
1802
1854
|
throw Error("duplicate name '" + name + "' in " + this);
|
|
1803
1855
|
|
|
@@ -2399,7 +2451,7 @@ protobuf.loadSync = loadSync;
|
|
|
2399
2451
|
// Serialization
|
|
2400
2452
|
protobuf.encoder = require(13);
|
|
2401
2453
|
protobuf.decoder = require(12);
|
|
2402
|
-
protobuf.verifier = require(
|
|
2454
|
+
protobuf.verifier = require(37);
|
|
2403
2455
|
protobuf.converter = require(11);
|
|
2404
2456
|
|
|
2405
2457
|
// Reflection
|
|
@@ -2416,7 +2468,7 @@ protobuf.Method = require(20);
|
|
|
2416
2468
|
|
|
2417
2469
|
// Runtime
|
|
2418
2470
|
protobuf.Message = require(19);
|
|
2419
|
-
protobuf.wrappers = require(
|
|
2471
|
+
protobuf.wrappers = require(38);
|
|
2420
2472
|
|
|
2421
2473
|
// Utility
|
|
2422
2474
|
protobuf.types = require(32);
|
|
@@ -2428,7 +2480,7 @@ protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);
|
|
|
2428
2480
|
protobuf.Root._configure(protobuf.Type);
|
|
2429
2481
|
protobuf.Field._configure(protobuf.Type);
|
|
2430
2482
|
|
|
2431
|
-
},{"11":11,"12":12,"13":13,"14":14,"15":15,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"23":23,"26":26,"30":30,"31":31,"32":32,"33":33,"
|
|
2483
|
+
},{"11":11,"12":12,"13":13,"14":14,"15":15,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"23":23,"26":26,"30":30,"31":31,"32":32,"33":33,"37":37,"38":38}],17:[function(require,module,exports){
|
|
2432
2484
|
"use strict";
|
|
2433
2485
|
var protobuf = exports;
|
|
2434
2486
|
|
|
@@ -2441,8 +2493,8 @@ var protobuf = exports;
|
|
|
2441
2493
|
protobuf.build = "minimal";
|
|
2442
2494
|
|
|
2443
2495
|
// Serialization
|
|
2444
|
-
protobuf.Writer = require(
|
|
2445
|
-
protobuf.BufferWriter = require(
|
|
2496
|
+
protobuf.Writer = require(39);
|
|
2497
|
+
protobuf.BufferWriter = require(40);
|
|
2446
2498
|
protobuf.Reader = require(24);
|
|
2447
2499
|
protobuf.BufferReader = require(25);
|
|
2448
2500
|
|
|
@@ -2466,7 +2518,7 @@ function configure() {
|
|
|
2466
2518
|
// Set up buffer utility according to the environment
|
|
2467
2519
|
configure();
|
|
2468
2520
|
|
|
2469
|
-
},{"24":24,"25":25,"27":27,"28":28,"35":35,"
|
|
2521
|
+
},{"24":24,"25":25,"27":27,"28":28,"35":35,"39":39,"40":40}],18:[function(require,module,exports){
|
|
2470
2522
|
"use strict";
|
|
2471
2523
|
module.exports = MapField;
|
|
2472
2524
|
|
|
@@ -3020,7 +3072,7 @@ function Namespace(name, options) {
|
|
|
3020
3072
|
* @type {Object.<string,ReflectionObject|null>}
|
|
3021
3073
|
* @private
|
|
3022
3074
|
*/
|
|
3023
|
-
this._lookupCache =
|
|
3075
|
+
this._lookupCache = Object.create(null);
|
|
3024
3076
|
|
|
3025
3077
|
/**
|
|
3026
3078
|
* Whether or not objects contained in this namespace need feature resolution.
|
|
@@ -3039,12 +3091,12 @@ function Namespace(name, options) {
|
|
|
3039
3091
|
|
|
3040
3092
|
function clearCache(namespace) {
|
|
3041
3093
|
namespace._nestedArray = null;
|
|
3042
|
-
namespace._lookupCache =
|
|
3094
|
+
namespace._lookupCache = Object.create(null);
|
|
3043
3095
|
|
|
3044
3096
|
// Also clear parent caches, since they include nested lookups.
|
|
3045
3097
|
var parent = namespace;
|
|
3046
3098
|
while(parent = parent.parent) {
|
|
3047
|
-
parent._lookupCache =
|
|
3099
|
+
parent._lookupCache = Object.create(null);
|
|
3048
3100
|
}
|
|
3049
3101
|
return namespace;
|
|
3050
3102
|
}
|
|
@@ -3125,8 +3177,9 @@ Namespace.prototype.addJSON = function addJSON(nestedJson) {
|
|
|
3125
3177
|
* @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist
|
|
3126
3178
|
*/
|
|
3127
3179
|
Namespace.prototype.get = function get(name) {
|
|
3128
|
-
return this.nested && this.nested
|
|
3129
|
-
|
|
3180
|
+
return this.nested && Object.prototype.hasOwnProperty.call(this.nested, name)
|
|
3181
|
+
? this.nested[name]
|
|
3182
|
+
: null;
|
|
3130
3183
|
};
|
|
3131
3184
|
|
|
3132
3185
|
/**
|
|
@@ -3137,7 +3190,7 @@ Namespace.prototype.get = function get(name) {
|
|
|
3137
3190
|
* @throws {Error} If there is no such enum
|
|
3138
3191
|
*/
|
|
3139
3192
|
Namespace.prototype.getEnum = function getEnum(name) {
|
|
3140
|
-
if (this.nested && this.nested[name] instanceof Enum)
|
|
3193
|
+
if (this.nested && Object.prototype.hasOwnProperty.call(this.nested, name) && this.nested[name] instanceof Enum)
|
|
3141
3194
|
return this.nested[name].values;
|
|
3142
3195
|
throw Error("no such enum: " + name);
|
|
3143
3196
|
};
|
|
@@ -3154,6 +3207,9 @@ Namespace.prototype.add = function add(object) {
|
|
|
3154
3207
|
if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof OneOf || object instanceof Enum || object instanceof Service || object instanceof Namespace))
|
|
3155
3208
|
throw TypeError("object must be a valid nested object");
|
|
3156
3209
|
|
|
3210
|
+
if (object.name === "__proto__")
|
|
3211
|
+
return this;
|
|
3212
|
+
|
|
3157
3213
|
if (!this.nested)
|
|
3158
3214
|
this.nested = {};
|
|
3159
3215
|
else {
|
|
@@ -3735,6 +3791,8 @@ ReflectionObject.prototype.getOption = function getOption(name) {
|
|
|
3735
3791
|
* @returns {ReflectionObject} `this`
|
|
3736
3792
|
*/
|
|
3737
3793
|
ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {
|
|
3794
|
+
if (name === "__proto__")
|
|
3795
|
+
return this;
|
|
3738
3796
|
if (!this.options)
|
|
3739
3797
|
this.options = {};
|
|
3740
3798
|
if (/^features\./.test(name)) {
|
|
@@ -3755,6 +3813,8 @@ ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet)
|
|
|
3755
3813
|
* @returns {ReflectionObject} `this`
|
|
3756
3814
|
*/
|
|
3757
3815
|
ReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) {
|
|
3816
|
+
if (name === "__proto__")
|
|
3817
|
+
return this;
|
|
3758
3818
|
if (!this.parsedOptions) {
|
|
3759
3819
|
this.parsedOptions = [];
|
|
3760
3820
|
}
|
|
@@ -4408,12 +4468,22 @@ Reader.prototype.skip = function skip(length) {
|
|
|
4408
4468
|
return this;
|
|
4409
4469
|
};
|
|
4410
4470
|
|
|
4471
|
+
/**
|
|
4472
|
+
* Recursion limit.
|
|
4473
|
+
* @type {number}
|
|
4474
|
+
*/
|
|
4475
|
+
Reader.recursionLimit = util.recursionLimit;
|
|
4476
|
+
|
|
4411
4477
|
/**
|
|
4412
4478
|
* Skips the next element of the specified wire type.
|
|
4413
4479
|
* @param {number} wireType Wire type received
|
|
4480
|
+
* @param {number} [depth] Depth of recursion to control nested calls; 0 if omitted
|
|
4414
4481
|
* @returns {Reader} `this`
|
|
4415
4482
|
*/
|
|
4416
|
-
Reader.prototype.skipType = function(wireType) {
|
|
4483
|
+
Reader.prototype.skipType = function(wireType, depth) {
|
|
4484
|
+
if (depth === undefined) depth = 0;
|
|
4485
|
+
if (depth > Reader.recursionLimit)
|
|
4486
|
+
throw Error("maximum nesting depth exceeded");
|
|
4417
4487
|
switch (wireType) {
|
|
4418
4488
|
case 0:
|
|
4419
4489
|
this.skip();
|
|
@@ -4426,7 +4496,7 @@ Reader.prototype.skipType = function(wireType) {
|
|
|
4426
4496
|
break;
|
|
4427
4497
|
case 3:
|
|
4428
4498
|
while ((wireType = this.uint32() & 7) !== 4) {
|
|
4429
|
-
this.skipType(wireType);
|
|
4499
|
+
this.skipType(wireType, depth + 1);
|
|
4430
4500
|
}
|
|
4431
4501
|
break;
|
|
4432
4502
|
case 5:
|
|
@@ -5144,6 +5214,8 @@ var Method = require(20),
|
|
|
5144
5214
|
util = require(33),
|
|
5145
5215
|
rpc = require(28);
|
|
5146
5216
|
|
|
5217
|
+
var reservedRe = util.patterns.reservedRe;
|
|
5218
|
+
|
|
5147
5219
|
/**
|
|
5148
5220
|
* Constructs a new service instance.
|
|
5149
5221
|
* @classdesc Reflected service.
|
|
@@ -5237,8 +5309,9 @@ function clearCache(service) {
|
|
|
5237
5309
|
* @override
|
|
5238
5310
|
*/
|
|
5239
5311
|
Service.prototype.get = function get(name) {
|
|
5240
|
-
return this.methods
|
|
5241
|
-
|
|
5312
|
+
return Object.prototype.hasOwnProperty.call(this.methods, name)
|
|
5313
|
+
? this.methods[name]
|
|
5314
|
+
: Namespace.prototype.get.call(this, name);
|
|
5242
5315
|
};
|
|
5243
5316
|
|
|
5244
5317
|
/**
|
|
@@ -5273,12 +5346,13 @@ Service.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive
|
|
|
5273
5346
|
* @override
|
|
5274
5347
|
*/
|
|
5275
5348
|
Service.prototype.add = function add(object) {
|
|
5276
|
-
|
|
5277
5349
|
/* istanbul ignore if */
|
|
5278
5350
|
if (this.get(object.name))
|
|
5279
5351
|
throw Error("duplicate name '" + object.name + "' in " + this);
|
|
5280
5352
|
|
|
5281
5353
|
if (object instanceof Method) {
|
|
5354
|
+
if (object.name === "__proto__")
|
|
5355
|
+
return this;
|
|
5282
5356
|
this.methods[object.name] = object;
|
|
5283
5357
|
object.parent = this;
|
|
5284
5358
|
return clearCache(this);
|
|
@@ -5314,7 +5388,7 @@ Service.prototype.create = function create(rpcImpl, requestDelimited, responseDe
|
|
|
5314
5388
|
var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);
|
|
5315
5389
|
for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {
|
|
5316
5390
|
var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, "");
|
|
5317
|
-
rpcService[methodName] = util.codegen(["r","c"],
|
|
5391
|
+
rpcService[methodName] = util.codegen(["r","c"], reservedRe.test(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({
|
|
5318
5392
|
m: method,
|
|
5319
5393
|
q: method.resolvedRequestType.ctor,
|
|
5320
5394
|
s: method.resolvedResponseType.ctor
|
|
@@ -5338,13 +5412,13 @@ var Enum = require(14),
|
|
|
5338
5412
|
Service = require(30),
|
|
5339
5413
|
Message = require(19),
|
|
5340
5414
|
Reader = require(24),
|
|
5341
|
-
Writer = require(
|
|
5415
|
+
Writer = require(39),
|
|
5342
5416
|
util = require(33),
|
|
5343
5417
|
encoder = require(13),
|
|
5344
5418
|
decoder = require(12),
|
|
5345
|
-
verifier = require(
|
|
5419
|
+
verifier = require(37),
|
|
5346
5420
|
converter = require(11),
|
|
5347
|
-
wrappers = require(
|
|
5421
|
+
wrappers = require(38);
|
|
5348
5422
|
|
|
5349
5423
|
/**
|
|
5350
5424
|
* Constructs a new reflected message type instance.
|
|
@@ -5531,7 +5605,7 @@ Type.generateConstructor = function generateConstructor(mtype) {
|
|
|
5531
5605
|
else if (field.repeated) gen
|
|
5532
5606
|
("this%s=[]", util.safeProp(field.name));
|
|
5533
5607
|
return gen
|
|
5534
|
-
("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)") // omit undefined or null
|
|
5608
|
+
("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null&&ks[i]!==\"__proto__\")") // omit undefined or null
|
|
5535
5609
|
("this[ks[i]]=p[ks[i]]");
|
|
5536
5610
|
/* eslint-enable no-unexpected-multiline */
|
|
5537
5611
|
};
|
|
@@ -5664,10 +5738,13 @@ Type.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(ed
|
|
|
5664
5738
|
* @override
|
|
5665
5739
|
*/
|
|
5666
5740
|
Type.prototype.get = function get(name) {
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5741
|
+
if (Object.prototype.hasOwnProperty.call(this.fields, name))
|
|
5742
|
+
return this.fields[name];
|
|
5743
|
+
if (this.oneofs && Object.prototype.hasOwnProperty.call(this.oneofs, name))
|
|
5744
|
+
return this.oneofs[name];
|
|
5745
|
+
if (this.nested && Object.prototype.hasOwnProperty.call(this.nested, name))
|
|
5746
|
+
return this.nested[name];
|
|
5747
|
+
return null;
|
|
5671
5748
|
};
|
|
5672
5749
|
|
|
5673
5750
|
/**
|
|
@@ -5678,7 +5755,6 @@ Type.prototype.get = function get(name) {
|
|
|
5678
5755
|
* @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id
|
|
5679
5756
|
*/
|
|
5680
5757
|
Type.prototype.add = function add(object) {
|
|
5681
|
-
|
|
5682
5758
|
if (this.get(object.name))
|
|
5683
5759
|
throw Error("duplicate name '" + object.name + "' in " + this);
|
|
5684
5760
|
|
|
@@ -5694,6 +5770,8 @@ Type.prototype.add = function add(object) {
|
|
|
5694
5770
|
throw Error("id " + object.id + " is reserved in " + this);
|
|
5695
5771
|
if (this.isReservedName(object.name))
|
|
5696
5772
|
throw Error("name '" + object.name + "' is reserved in " + this);
|
|
5773
|
+
if (object.name === "__proto__")
|
|
5774
|
+
return this;
|
|
5697
5775
|
|
|
5698
5776
|
if (object.parent)
|
|
5699
5777
|
object.parent.remove(object);
|
|
@@ -5703,6 +5781,8 @@ Type.prototype.add = function add(object) {
|
|
|
5703
5781
|
return clearCache(this);
|
|
5704
5782
|
}
|
|
5705
5783
|
if (object instanceof OneOf) {
|
|
5784
|
+
if (object.name === "__proto__")
|
|
5785
|
+
return this;
|
|
5706
5786
|
if (!this.oneofs)
|
|
5707
5787
|
this.oneofs = {};
|
|
5708
5788
|
this.oneofs[object.name] = object;
|
|
@@ -5851,12 +5931,14 @@ Type.prototype.encodeDelimited = function encodeDelimited(message, writer) {
|
|
|
5851
5931
|
* Decodes a message of this type.
|
|
5852
5932
|
* @param {Reader|Uint8Array} reader Reader or buffer to decode from
|
|
5853
5933
|
* @param {number} [length] Length of the message, if known beforehand
|
|
5934
|
+
* @param {number} [end] Expected group end tag, if decoding a group
|
|
5935
|
+
* @param {number} [depth] Current nesting depth
|
|
5854
5936
|
* @returns {Message<{}>} Decoded message
|
|
5855
5937
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
5856
5938
|
* @throws {util.ProtocolError<{}>} If required fields are missing
|
|
5857
5939
|
*/
|
|
5858
|
-
Type.prototype.decode = function decode_setup(reader, length) {
|
|
5859
|
-
return this.setup().decode(reader, length); // overrides this method
|
|
5940
|
+
Type.prototype.decode = function decode_setup(reader, length, end, depth) {
|
|
5941
|
+
return this.setup().decode(reader, length, end, depth); // overrides this method
|
|
5860
5942
|
};
|
|
5861
5943
|
|
|
5862
5944
|
/**
|
|
@@ -5875,19 +5957,21 @@ Type.prototype.decodeDelimited = function decodeDelimited(reader) {
|
|
|
5875
5957
|
/**
|
|
5876
5958
|
* Verifies that field values are valid and that required fields are present.
|
|
5877
5959
|
* @param {Object.<string,*>} message Plain object to verify
|
|
5960
|
+
* @param {number} [depth] Current nesting depth
|
|
5878
5961
|
* @returns {null|string} `null` if valid, otherwise the reason why it is not
|
|
5879
5962
|
*/
|
|
5880
|
-
Type.prototype.verify = function verify_setup(message) {
|
|
5881
|
-
return this.setup().verify(message); // overrides this method
|
|
5963
|
+
Type.prototype.verify = function verify_setup(message, depth) {
|
|
5964
|
+
return this.setup().verify(message, depth); // overrides this method
|
|
5882
5965
|
};
|
|
5883
5966
|
|
|
5884
5967
|
/**
|
|
5885
5968
|
* Creates a new message of this type from a plain object. Also converts values to their respective internal types.
|
|
5886
5969
|
* @param {Object.<string,*>} object Plain object to convert
|
|
5970
|
+
* @param {number} [depth] Current nesting depth
|
|
5887
5971
|
* @returns {Message<{}>} Message instance
|
|
5888
5972
|
*/
|
|
5889
|
-
Type.prototype.fromObject = function fromObject(object) {
|
|
5890
|
-
return this.setup().fromObject(object);
|
|
5973
|
+
Type.prototype.fromObject = function fromObject(object, depth) {
|
|
5974
|
+
return this.setup().fromObject(object, depth);
|
|
5891
5975
|
};
|
|
5892
5976
|
|
|
5893
5977
|
/**
|
|
@@ -5940,7 +6024,7 @@ Type.d = function decorateType(typeName) {
|
|
|
5940
6024
|
};
|
|
5941
6025
|
};
|
|
5942
6026
|
|
|
5943
|
-
},{"11":11,"12":12,"13":13,"14":14,"15":15,"18":18,"19":19,"21":21,"23":23,"24":24,"30":30,"33":33,"
|
|
6027
|
+
},{"11":11,"12":12,"13":13,"14":14,"15":15,"18":18,"19":19,"21":21,"23":23,"24":24,"30":30,"33":33,"37":37,"38":38,"39":39}],32:[function(require,module,exports){
|
|
5944
6028
|
"use strict";
|
|
5945
6029
|
|
|
5946
6030
|
/**
|
|
@@ -5970,7 +6054,7 @@ var s = [
|
|
|
5970
6054
|
];
|
|
5971
6055
|
|
|
5972
6056
|
function bake(values, offset) {
|
|
5973
|
-
var i = 0, o =
|
|
6057
|
+
var i = 0, o = Object.create(null);
|
|
5974
6058
|
offset |= 0;
|
|
5975
6059
|
while (i < values.length) o[s[i + offset]] = values[i++];
|
|
5976
6060
|
return o;
|
|
@@ -6155,6 +6239,10 @@ var Type, // cyclic
|
|
|
6155
6239
|
util.codegen = require(3);
|
|
6156
6240
|
util.fetch = require(5);
|
|
6157
6241
|
util.path = require(8);
|
|
6242
|
+
util.patterns = require(36);
|
|
6243
|
+
|
|
6244
|
+
var reservedRe = util.patterns.reservedRe,
|
|
6245
|
+
unsafePropertyRe = util.patterns.unsafePropertyRe;
|
|
6158
6246
|
|
|
6159
6247
|
/**
|
|
6160
6248
|
* Node's fs module if available.
|
|
@@ -6196,16 +6284,13 @@ util.toObject = function toObject(array) {
|
|
|
6196
6284
|
return object;
|
|
6197
6285
|
};
|
|
6198
6286
|
|
|
6199
|
-
var safePropBackslashRe = /\\/g,
|
|
6200
|
-
safePropQuoteRe = /"/g;
|
|
6201
|
-
|
|
6202
6287
|
/**
|
|
6203
6288
|
* Tests whether the specified name is a reserved word in JS.
|
|
6204
6289
|
* @param {string} name Name to test
|
|
6205
6290
|
* @returns {boolean} `true` if reserved, otherwise `false`
|
|
6206
6291
|
*/
|
|
6207
6292
|
util.isReserved = function isReserved(name) {
|
|
6208
|
-
return
|
|
6293
|
+
return reservedRe.test(name);
|
|
6209
6294
|
};
|
|
6210
6295
|
|
|
6211
6296
|
/**
|
|
@@ -6214,8 +6299,8 @@ util.isReserved = function isReserved(name) {
|
|
|
6214
6299
|
* @returns {string} Safe accessor
|
|
6215
6300
|
*/
|
|
6216
6301
|
util.safeProp = function safeProp(prop) {
|
|
6217
|
-
if (!/^[$\w_]+$/.test(prop) ||
|
|
6218
|
-
return "[
|
|
6302
|
+
if (!/^[$\w_]+$/.test(prop) || reservedRe.test(prop))
|
|
6303
|
+
return "[" + JSON.stringify(prop) + "]";
|
|
6219
6304
|
return "." + prop;
|
|
6220
6305
|
};
|
|
6221
6306
|
|
|
@@ -6318,9 +6403,8 @@ util.decorateEnum = function decorateEnum(object) {
|
|
|
6318
6403
|
util.setProperty = function setProperty(dst, path, value, ifNotSet) {
|
|
6319
6404
|
function setProp(dst, path, value) {
|
|
6320
6405
|
var part = path.shift();
|
|
6321
|
-
if (part
|
|
6322
|
-
|
|
6323
|
-
}
|
|
6406
|
+
if (unsafePropertyRe.test(part))
|
|
6407
|
+
return dst;
|
|
6324
6408
|
if (path.length > 0) {
|
|
6325
6409
|
dst[part] = setProp(dst[part] || {}, path, value);
|
|
6326
6410
|
} else {
|
|
@@ -6355,7 +6439,7 @@ Object.defineProperty(util, "decorateRoot", {
|
|
|
6355
6439
|
}
|
|
6356
6440
|
});
|
|
6357
6441
|
|
|
6358
|
-
},{"14":14,"26":26,"27":27,"3":3,"31":31,"35":35,"5":5,"8":8}],34:[function(require,module,exports){
|
|
6442
|
+
},{"14":14,"26":26,"27":27,"3":3,"31":31,"35":35,"36":36,"5":5,"8":8}],34:[function(require,module,exports){
|
|
6359
6443
|
"use strict";
|
|
6360
6444
|
module.exports = LongBits;
|
|
6361
6445
|
|
|
@@ -6797,12 +6881,35 @@ util.longFromHash = function longFromHash(hash, unsigned) {
|
|
|
6797
6881
|
function merge(dst, src, ifNotSet) { // used by converters
|
|
6798
6882
|
for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)
|
|
6799
6883
|
if (dst[keys[i]] === undefined || !ifNotSet)
|
|
6800
|
-
|
|
6884
|
+
if (keys[i] !== "__proto__")
|
|
6885
|
+
dst[keys[i]] = src[keys[i]];
|
|
6801
6886
|
return dst;
|
|
6802
6887
|
}
|
|
6803
6888
|
|
|
6804
6889
|
util.merge = merge;
|
|
6805
6890
|
|
|
6891
|
+
/**
|
|
6892
|
+
* Recursion limit.
|
|
6893
|
+
* @memberof util
|
|
6894
|
+
* @type {number}
|
|
6895
|
+
*/
|
|
6896
|
+
util.recursionLimit = 100;
|
|
6897
|
+
|
|
6898
|
+
/**
|
|
6899
|
+
* Makes a property safe for assignment as an own property.
|
|
6900
|
+
* @memberof util
|
|
6901
|
+
* @param {Object.<string,*>} obj Object
|
|
6902
|
+
* @param {string} key Property key
|
|
6903
|
+
* @returns {undefined}
|
|
6904
|
+
*/
|
|
6905
|
+
util.makeProp = function makeProp(obj, key) {
|
|
6906
|
+
Object.defineProperty(obj, key, {
|
|
6907
|
+
enumerable: true,
|
|
6908
|
+
configurable: true,
|
|
6909
|
+
writable: true
|
|
6910
|
+
});
|
|
6911
|
+
};
|
|
6912
|
+
|
|
6806
6913
|
/**
|
|
6807
6914
|
* Converts the first character of a string to lower case.
|
|
6808
6915
|
* @param {string} str String to convert
|
|
@@ -6999,6 +7106,16 @@ util._configure = function() {
|
|
|
6999
7106
|
|
|
7000
7107
|
},{"1":1,"10":10,"2":2,"34":34,"4":4,"6":6,"7":7,"9":9}],36:[function(require,module,exports){
|
|
7001
7108
|
"use strict";
|
|
7109
|
+
|
|
7110
|
+
var patterns = exports;
|
|
7111
|
+
|
|
7112
|
+
patterns.numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;
|
|
7113
|
+
patterns.typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
|
|
7114
|
+
patterns.reservedRe = /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;
|
|
7115
|
+
patterns.unsafePropertyRe = /^(?:__proto__|prototype|constructor)$/;
|
|
7116
|
+
|
|
7117
|
+
},{}],37:[function(require,module,exports){
|
|
7118
|
+
"use strict";
|
|
7002
7119
|
module.exports = verifier;
|
|
7003
7120
|
|
|
7004
7121
|
var Enum = require(14),
|
|
@@ -7032,7 +7149,7 @@ function genVerifyValue(gen, field, fieldIndex, ref) {
|
|
|
7032
7149
|
} else {
|
|
7033
7150
|
gen
|
|
7034
7151
|
("{")
|
|
7035
|
-
("var e=types[%i].verify(%s);", fieldIndex, ref)
|
|
7152
|
+
("var e=types[%i].verify(%s,n+1);", fieldIndex, ref)
|
|
7036
7153
|
("if(e)")
|
|
7037
7154
|
("return%j+e", field.name + ".")
|
|
7038
7155
|
("}");
|
|
@@ -7122,9 +7239,12 @@ function genVerifyKey(gen, field, ref) {
|
|
|
7122
7239
|
function verifier(mtype) {
|
|
7123
7240
|
/* eslint-disable no-unexpected-multiline */
|
|
7124
7241
|
|
|
7125
|
-
var gen = util.codegen(["m"], mtype.name + "$verify")
|
|
7242
|
+
var gen = util.codegen(["m", "n"], mtype.name + "$verify")
|
|
7126
7243
|
("if(typeof m!==\"object\"||m===null)")
|
|
7127
|
-
("return%j", "object expected")
|
|
7244
|
+
("return%j", "object expected")
|
|
7245
|
+
("if(n===undefined)n=0")
|
|
7246
|
+
("if(n>util.recursionLimit)")
|
|
7247
|
+
("return%j", "maximum nesting depth exceeded");
|
|
7128
7248
|
var oneofs = mtype.oneofsArray,
|
|
7129
7249
|
seenFirstField = {};
|
|
7130
7250
|
if (oneofs.length) gen
|
|
@@ -7175,7 +7295,8 @@ function verifier(mtype) {
|
|
|
7175
7295
|
("return null");
|
|
7176
7296
|
/* eslint-enable no-unexpected-multiline */
|
|
7177
7297
|
}
|
|
7178
|
-
|
|
7298
|
+
|
|
7299
|
+
},{"14":14,"33":33}],38:[function(require,module,exports){
|
|
7179
7300
|
"use strict";
|
|
7180
7301
|
|
|
7181
7302
|
/**
|
|
@@ -7216,7 +7337,7 @@ var Message = require(19);
|
|
|
7216
7337
|
// Custom wrapper for Any
|
|
7217
7338
|
wrappers[".google.protobuf.Any"] = {
|
|
7218
7339
|
|
|
7219
|
-
fromObject: function(object) {
|
|
7340
|
+
fromObject: function(object, depth) {
|
|
7220
7341
|
|
|
7221
7342
|
// unwrap value type if mapped
|
|
7222
7343
|
if (object && object["@type"]) {
|
|
@@ -7232,14 +7353,15 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
7232
7353
|
if (type_url.indexOf("/") === -1) {
|
|
7233
7354
|
type_url = "/" + type_url;
|
|
7234
7355
|
}
|
|
7356
|
+
var nextDepth = depth === undefined ? 1 : depth + 1;
|
|
7235
7357
|
return this.create({
|
|
7236
7358
|
type_url: type_url,
|
|
7237
|
-
value: type.encode(type.fromObject(object)).finish()
|
|
7359
|
+
value: type.encode(type.fromObject(object, nextDepth)).finish()
|
|
7238
7360
|
});
|
|
7239
7361
|
}
|
|
7240
7362
|
}
|
|
7241
7363
|
|
|
7242
|
-
return this.fromObject(object);
|
|
7364
|
+
return this.fromObject(object, depth);
|
|
7243
7365
|
},
|
|
7244
7366
|
|
|
7245
7367
|
toObject: function(message, options) {
|
|
@@ -7279,7 +7401,7 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
7279
7401
|
}
|
|
7280
7402
|
};
|
|
7281
7403
|
|
|
7282
|
-
},{"19":19}],
|
|
7404
|
+
},{"19":19}],39:[function(require,module,exports){
|
|
7283
7405
|
"use strict";
|
|
7284
7406
|
module.exports = Writer;
|
|
7285
7407
|
|
|
@@ -7746,12 +7868,12 @@ Writer._configure = function(BufferWriter_) {
|
|
|
7746
7868
|
BufferWriter._configure();
|
|
7747
7869
|
};
|
|
7748
7870
|
|
|
7749
|
-
},{"35":35}],
|
|
7871
|
+
},{"35":35}],40:[function(require,module,exports){
|
|
7750
7872
|
"use strict";
|
|
7751
7873
|
module.exports = BufferWriter;
|
|
7752
7874
|
|
|
7753
7875
|
// extends Writer
|
|
7754
|
-
var Writer = require(
|
|
7876
|
+
var Writer = require(39);
|
|
7755
7877
|
(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;
|
|
7756
7878
|
|
|
7757
7879
|
var util = require(35);
|
|
@@ -7833,7 +7955,7 @@ BufferWriter.prototype.string = function write_string_buffer(value) {
|
|
|
7833
7955
|
|
|
7834
7956
|
BufferWriter._configure();
|
|
7835
7957
|
|
|
7836
|
-
},{"35":35,"
|
|
7958
|
+
},{"35":35,"39":39}]},{},[16])
|
|
7837
7959
|
|
|
7838
7960
|
})();
|
|
7839
7961
|
//# sourceMappingURL=protobuf.js.map
|