8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb8c3ab commit d7f3c7aCopy full SHA for d7f3c7a
binary/decoder.js
@@ -481,13 +481,13 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() {
481
482
483
/**
484
- * The readUnsignedVarint32 above deals with signed 32-bit varints correctly,
485
- * so this is just an alias.
+ * Coerces the output of readUnsignedVarint32 to an int32.
486
*
487
* @return {number} The decoded signed 32-bit varint.
488
*/
489
-jspb.BinaryDecoder.prototype.readSignedVarint32 =
490
- jspb.BinaryDecoder.prototype.readUnsignedVarint32;
+jspb.BinaryDecoder.prototype.readSignedVarint32 = function() {
+ return ~~(this.readUnsignedVarint32());
+}
491
492
493
0 commit comments