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/light/protobuf.js +13 -8
- 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 +10 -5
- 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 +19 -13
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/package.json +1 -1
- package/src/converter.js +2 -2
- package/src/parse.js +4 -1
- package/src/reader.js +8 -3
- package/src/tokenize.js +2 -4
- package/src/util.js +1 -1
package/package.json
CHANGED
package/src/converter.js
CHANGED
|
@@ -62,7 +62,7 @@ function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
|
|
|
62
62
|
break;
|
|
63
63
|
case "uint64":
|
|
64
64
|
isUnsigned = true;
|
|
65
|
-
// eslint-disable-line no-fallthrough
|
|
65
|
+
// eslint-disable-next-line no-fallthrough
|
|
66
66
|
case "int64":
|
|
67
67
|
case "sint64":
|
|
68
68
|
case "fixed64":
|
|
@@ -176,7 +176,7 @@ function genValuePartial_toObject(gen, field, fieldIndex, prop) {
|
|
|
176
176
|
break;
|
|
177
177
|
case "uint64":
|
|
178
178
|
isUnsigned = true;
|
|
179
|
-
// eslint-disable-line no-fallthrough
|
|
179
|
+
// eslint-disable-next-line no-fallthrough
|
|
180
180
|
case "int64":
|
|
181
181
|
case "sint64":
|
|
182
182
|
case "fixed64":
|
package/src/parse.js
CHANGED
|
@@ -227,7 +227,7 @@ function parse(source, root, options) {
|
|
|
227
227
|
break;
|
|
228
228
|
case "public":
|
|
229
229
|
next();
|
|
230
|
-
// eslint-disable-line no-fallthrough
|
|
230
|
+
// eslint-disable-next-line no-fallthrough
|
|
231
231
|
default:
|
|
232
232
|
whichImports = imports || (imports = []);
|
|
233
233
|
break;
|
|
@@ -621,6 +621,9 @@ function parse(source, root, options) {
|
|
|
621
621
|
if (!nameRe.test(token = next())) {
|
|
622
622
|
throw illegal(token, "name");
|
|
623
623
|
}
|
|
624
|
+
if (token === null) {
|
|
625
|
+
throw illegal(token, "end of input");
|
|
626
|
+
}
|
|
624
627
|
|
|
625
628
|
var value;
|
|
626
629
|
var propName = token;
|
package/src/reader.js
CHANGED
|
@@ -312,9 +312,14 @@ Reader.prototype.bytes = function read_bytes() {
|
|
|
312
312
|
this.pos += length;
|
|
313
313
|
if (Array.isArray(this.buf)) // plain array
|
|
314
314
|
return this.buf.slice(start, end);
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
315
|
+
|
|
316
|
+
if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1
|
|
317
|
+
var nativeBuffer = util.Buffer;
|
|
318
|
+
return nativeBuffer
|
|
319
|
+
? nativeBuffer.alloc(0)
|
|
320
|
+
: new this.buf.constructor(0);
|
|
321
|
+
}
|
|
322
|
+
return this._slice.call(this.buf, start, end);
|
|
318
323
|
};
|
|
319
324
|
|
|
320
325
|
/**
|
package/src/tokenize.js
CHANGED
|
@@ -197,9 +197,7 @@ function tokenize(source, alternateCommentMode) {
|
|
|
197
197
|
|
|
198
198
|
// see if remaining line matches comment pattern
|
|
199
199
|
var lineText = source.substring(startOffset, endOffset);
|
|
200
|
-
|
|
201
|
-
// the first slash that started the comment.
|
|
202
|
-
var isComment = /^\s*\/{1,2}/.test(lineText);
|
|
200
|
+
var isComment = /^\s*\/\//.test(lineText);
|
|
203
201
|
return isComment;
|
|
204
202
|
}
|
|
205
203
|
|
|
@@ -268,7 +266,7 @@ function tokenize(source, alternateCommentMode) {
|
|
|
268
266
|
// check for double-slash comments, consolidating consecutive lines
|
|
269
267
|
start = offset;
|
|
270
268
|
isDoc = false;
|
|
271
|
-
if (isDoubleSlashCommentLine(offset)) {
|
|
269
|
+
if (isDoubleSlashCommentLine(offset - 1)) {
|
|
272
270
|
isDoc = true;
|
|
273
271
|
do {
|
|
274
272
|
offset = findEndOfLine(offset);
|
package/src/util.js
CHANGED
|
@@ -176,7 +176,7 @@ util.decorateEnum = function decorateEnum(object) {
|
|
|
176
176
|
util.setProperty = function setProperty(dst, path, value) {
|
|
177
177
|
function setProp(dst, path, value) {
|
|
178
178
|
var part = path.shift();
|
|
179
|
-
if (part === "__proto__") {
|
|
179
|
+
if (part === "__proto__" || part === "prototype") {
|
|
180
180
|
return dst;
|
|
181
181
|
}
|
|
182
182
|
if (path.length > 0) {
|