protobufjs 7.2.3 → 7.2.5

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/protobuf.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v7.2.3 (c) 2016, daniel wirtz
3
- * compiled mon, 27 mar 2023 18:08:22 utc
2
+ * protobuf.js v7.2.5 (c) 2016, daniel wirtz
3
+ * compiled tue, 22 aug 2023 00:04:28 utc
4
4
  * licensed under the bsd-3-clause license
5
5
  * see: https://github.com/dcodeio/protobuf.js for details
6
6
  */
@@ -1574,7 +1574,7 @@ function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
1574
1574
  break;
1575
1575
  case "uint64":
1576
1576
  isUnsigned = true;
1577
- // eslint-disable-line no-fallthrough
1577
+ // eslint-disable-next-line no-fallthrough
1578
1578
  case "int64":
1579
1579
  case "sint64":
1580
1580
  case "fixed64":
@@ -1688,7 +1688,7 @@ function genValuePartial_toObject(gen, field, fieldIndex, prop) {
1688
1688
  break;
1689
1689
  case "uint64":
1690
1690
  isUnsigned = true;
1691
- // eslint-disable-line no-fallthrough
1691
+ // eslint-disable-next-line no-fallthrough
1692
1692
  case "int64":
1693
1693
  case "sint64":
1694
1694
  case "fixed64":
@@ -4327,7 +4327,7 @@ function parse(source, root, options) {
4327
4327
  break;
4328
4328
  case "public":
4329
4329
  next();
4330
- // eslint-disable-line no-fallthrough
4330
+ // eslint-disable-next-line no-fallthrough
4331
4331
  default:
4332
4332
  whichImports = imports || (imports = []);
4333
4333
  break;
@@ -4721,6 +4721,9 @@ function parse(source, root, options) {
4721
4721
  if (!nameRe.test(token = next())) {
4722
4722
  throw illegal(token, "name");
4723
4723
  }
4724
+ if (token === null) {
4725
+ throw illegal(token, "end of input");
4726
+ }
4724
4727
 
4725
4728
  var value;
4726
4729
  var propName = token;
@@ -5283,9 +5286,14 @@ Reader.prototype.bytes = function read_bytes() {
5283
5286
  this.pos += length;
5284
5287
  if (Array.isArray(this.buf)) // plain array
5285
5288
  return this.buf.slice(start, end);
5286
- return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1
5287
- ? new this.buf.constructor(0)
5288
- : this._slice.call(this.buf, start, end);
5289
+
5290
+ if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1
5291
+ var nativeBuffer = util.Buffer;
5292
+ return nativeBuffer
5293
+ ? nativeBuffer.alloc(0)
5294
+ : new this.buf.constructor(0);
5295
+ }
5296
+ return this._slice.call(this.buf, start, end);
5289
5297
  };
5290
5298
 
5291
5299
  /**
@@ -6375,9 +6383,7 @@ function tokenize(source, alternateCommentMode) {
6375
6383
 
6376
6384
  // see if remaining line matches comment pattern
6377
6385
  var lineText = source.substring(startOffset, endOffset);
6378
- // look for 1 or 2 slashes since startOffset would already point past
6379
- // the first slash that started the comment.
6380
- var isComment = /^\s*\/{1,2}/.test(lineText);
6386
+ var isComment = /^\s*\/\//.test(lineText);
6381
6387
  return isComment;
6382
6388
  }
6383
6389
 
@@ -6446,7 +6452,7 @@ function tokenize(source, alternateCommentMode) {
6446
6452
  // check for double-slash comments, consolidating consecutive lines
6447
6453
  start = offset;
6448
6454
  isDoc = false;
6449
- if (isDoubleSlashCommentLine(offset)) {
6455
+ if (isDoubleSlashCommentLine(offset - 1)) {
6450
6456
  isDoc = true;
6451
6457
  do {
6452
6458
  offset = findEndOfLine(offset);
@@ -7563,7 +7569,7 @@ util.decorateEnum = function decorateEnum(object) {
7563
7569
  util.setProperty = function setProperty(dst, path, value) {
7564
7570
  function setProp(dst, path, value) {
7565
7571
  var part = path.shift();
7566
- if (part === "__proto__") {
7572
+ if (part === "__proto__" || part === "prototype") {
7567
7573
  return dst;
7568
7574
  }
7569
7575
  if (path.length > 0) {