Skip to content

Commit d8b7dfb

Browse files
committed
Sync from Piper @353127564
PROTOBUF_SYNC_PIPER
2 parents 2ebdf33 + 2e5a12d commit d8b7dfb

4 files changed

Lines changed: 5 additions & 11 deletions

File tree

binary/decoder_test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ describe('binaryDecoderTest', function() {
315315
// 64-bit extremes, not in dev guide.
316316
{original: '9223372036854775807', zigzag: '18446744073709551614'},
317317
{original: '-9223372036854775808', zigzag: '18446744073709551615'},
318+
// None of the above catch: bitsLow < 0 && bitsHigh > 0 && bitsHigh <
319+
// 0x1FFFFF. The following used to be broken.
320+
{original: '72000000000', zigzag: '144000000000'},
318321
];
319322
var encoder = new jspb.BinaryEncoder();
320323
testCases.forEach(function(c) {

binary/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ jspb.utils.joinUnsignedDecimalString = function(bitsLow, bitsHigh) {
511511
// Skip the expensive conversion if the number is small enough to use the
512512
// built-in conversions.
513513
if (bitsHigh <= 0x1FFFFF) {
514-
return '' + (jspb.BinaryConstants.TWO_TO_32 * bitsHigh + bitsLow);
514+
return '' + jspb.utils.joinUint64(bitsLow, bitsHigh);
515515
}
516516

517517
// What this code is doing is essentially converting the input number from

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "google-protobuf",
3-
"version": "3.13.0",
3+
"version": "3.14.0",
44
"description": "Protocol Buffers for JavaScript",
55
"main": "google-protobuf.js",
66
"files": [

src/google/protobuf/compiler/js/js_generator.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,6 @@ bool StrEndsWith(StringPiece sp, StringPiece x) {
9999
return sp.size() >= x.size() && sp.substr(sp.size() - x.size()) == x;
100100
}
101101

102-
// Returns a copy of |filename| with any trailing ".protodevel" or ".proto
103-
// suffix stripped.
104-
// TODO(haberman): Unify with copy in compiler/cpp/internal/helpers.cc.
105-
std::string StripProto(const std::string& filename) {
106-
const char* suffix =
107-
StrEndsWith(filename, ".protodevel") ? ".protodevel" : ".proto";
108-
return StripSuffixString(filename, suffix);
109-
}
110-
111102
std::string GetSnakeFilename(const std::string& filename) {
112103
std::string snake_name = filename;
113104
ReplaceCharacters(&snake_name, "/", '_');

0 commit comments

Comments
 (0)