protobufjs 7.2.0 → 7.2.2
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 +7 -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 +2 -2
- package/dist/minimal/protobuf.min.js +3 -3
- package/dist/minimal/protobuf.min.js.map +1 -1
- package/dist/protobuf.js +7 -8
- 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/root.js +7 -2
- package/src/util/minimal.js +2 -2
package/package.json
CHANGED
package/src/root.js
CHANGED
|
@@ -98,10 +98,10 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
98
98
|
/* istanbul ignore if */
|
|
99
99
|
if (!callback)
|
|
100
100
|
return;
|
|
101
|
-
if (sync)
|
|
102
|
-
throw err;
|
|
103
101
|
var cb = callback;
|
|
104
102
|
callback = null;
|
|
103
|
+
if (sync)
|
|
104
|
+
throw err;
|
|
105
105
|
cb(err, root);
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -145,6 +145,7 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
145
145
|
|
|
146
146
|
// Fetches a single file
|
|
147
147
|
function fetch(filename, weak) {
|
|
148
|
+
filename = getBundledFileName(filename) || filename;
|
|
148
149
|
|
|
149
150
|
// Skip if already loaded / attempted
|
|
150
151
|
if (self.files.indexOf(filename) > -1)
|
|
@@ -273,6 +274,10 @@ function tryHandleExtension(root, field) {
|
|
|
273
274
|
var extendedType = field.parent.lookup(field.extend);
|
|
274
275
|
if (extendedType) {
|
|
275
276
|
var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);
|
|
277
|
+
//do not allow to extend same field twice to prevent the error
|
|
278
|
+
if (extendedType.get(sisterField.name)) {
|
|
279
|
+
return true;
|
|
280
|
+
}
|
|
276
281
|
sisterField.declaringField = field;
|
|
277
282
|
field.extensionField = sisterField;
|
|
278
283
|
extendedType.add(sisterField);
|
package/src/util/minimal.js
CHANGED
|
@@ -288,7 +288,7 @@ function newError(name) {
|
|
|
288
288
|
configurable: true,
|
|
289
289
|
},
|
|
290
290
|
name: {
|
|
291
|
-
get() { return name; },
|
|
291
|
+
get: function get() { return name; },
|
|
292
292
|
set: undefined,
|
|
293
293
|
enumerable: false,
|
|
294
294
|
// configurable: false would accurately preserve the behavior of
|
|
@@ -298,7 +298,7 @@ function newError(name) {
|
|
|
298
298
|
configurable: true,
|
|
299
299
|
},
|
|
300
300
|
toString: {
|
|
301
|
-
value() { return this.name + ": " + this.message; },
|
|
301
|
+
value: function value() { return this.name + ": " + this.message; },
|
|
302
302
|
writable: true,
|
|
303
303
|
enumerable: false,
|
|
304
304
|
configurable: true,
|