When encoding a long field set to null (which is typical of a JSON object), instead of the field being ignored the code throws an exception. I don't see a reason not to support the old behavior. Null or undefined override on a nulled field should ignore it from being encoded on the byte stream.
util.longNe = function longNe(val, lo, hi) {
if (typeof val === "object") // Long-like, null is invalid and throws
return val.low !== lo || val.high !== hi;
var bits = util.LongBits.from(val);
return bits.lo !== lo || bits.hi !== hi;
};
When encoding a long field set to null (which is typical of a JSON object), instead of the field being ignored the code throws an exception. I don't see a reason not to support the old behavior. Null or undefined override on a nulled field should ignore it from being encoded on the byte stream.