Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions binary/bytesource_alias.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* @fileoverview Legacy alias for the old namespace used by encoder.js
*/
goog.module('jspb.ByteSource');
goog.module.declareLegacyNamespace();

const { ByteSource } = goog.require('jspb.binary.bytesource');

exports = ByteSource;
2 changes: 1 addition & 1 deletion binary/encoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class BinaryEncoder {
utils.splitZigzag64(value);
this.writeSplitVarint64(utils.getSplit64Low(), utils.getSplit64High());
}

/**
* Encodes a JavaScript decimal string into its wire-format, zigzag-encoded
* varint representation and stores it in the buffer. Integers not
Expand Down
1 change: 1 addition & 0 deletions binary/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ goog.module.declareLegacyNamespace();
const BinaryConstants = goog.require('jspb.BinaryConstants');
const { assert } = goog.require('goog.asserts');
const { isBigIntAvailable } = goog.require('jspb.internal_options');
const { ByteSource } = goog.require('jspb.binary.bytesource');
const { ByteString } = goog.require('jspb.bytestring');
const { decodeStringToUint8Array } = goog.require('goog.crypt.base64');
const { unsafeUint8ArrayFromByteString } = goog.require('jspb.unsafe_bytestring');
Expand Down
8 changes: 0 additions & 8 deletions binary/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,6 @@ class BinaryWriter {
this.encoder_.writeZigzagVarint64(/** @type {number} */(value));
break;

case 'bigint':
this.encoder_.writeZigzagVarint64BigInt(/** @type {bigint} */(value));
break;

default:
this.encoder_.writeZigzagVarint64String(/** @type {string} */(value));
break;
Expand Down Expand Up @@ -1425,10 +1421,6 @@ class BinaryWriter {
this.encoder_.writeZigzagVarint64(v);
break;

case 'bigint':
this.encoder_.writeZigzagVarint64BigInt(/** @type {bigint} */(v));
break;

default:
this.encoder_.writeZigzagVarint64String(/** @type {string} */(v));
break;
Expand Down
3 changes: 2 additions & 1 deletion generator/js_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,7 @@ void Generator::GenerateRequiresImpl(const GeneratorOptions& options,
required->insert("jspb.internal.public_for_gencode");
required->insert("jspb.BinaryReader");
required->insert("jspb.BinaryWriter");
required->insert("jspb.binary.bytesource");
}
if (require_extension) {
required->insert("jspb.ExtensionFieldBinaryInfo");
Expand Down Expand Up @@ -3016,7 +3017,7 @@ void Generator::GenerateClassDeserializeBinary(const GeneratorOptions& options,
printer->Print(
"/**\n"
" * Deserializes binary data (in protobuf wire format).\n"
" * @param {jspb.ByteSource} bytes The bytes to deserialize.\n"
" * @param {jspb.binary.bytesource.ByteSource} bytes The bytes to deserialize.\n"
" * @return {!$class$}\n"
" */\n"
"$class$.deserializeBinary = function(bytes) {\n"
Expand Down
2 changes: 1 addition & 1 deletion internal_public.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ goog.module.declareLegacyNamespace();
const asserts = goog.require('goog.asserts');
const { BinaryReader } = goog.require('jspb.binary.reader');
const { BinaryWriter } = goog.requireType('jspb.binary.writer');
const {Map: JspbMap} = goog.requireType('jspb.Map');
const JspbMap = goog.requireType('jspb.Map');

/**
* Write this Map field in wire format to a BinaryWriter, using the given
Expand Down
4 changes: 2 additions & 2 deletions message.js
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,7 @@ jspb.Message.clone_ = function(obj) {
// NOTE:redundant null check existing for NTI compatibility.
// see b/70515949
clonedArray[i] = (typeof o == 'object') ?
jspb.Message.clone_(jspb.asserts.assert(o)) :
jspb.Message.clone_(/** @type {!Object} */(jspb.asserts.assert(o))) :
o;
}
}
Expand All @@ -1892,7 +1892,7 @@ jspb.Message.clone_ = function(obj) {
// NOTE:redundant null check existing for NTI compatibility.
// see b/70515949
clone[key] = (typeof o == 'object') ?
jspb.Message.clone_(jspb.asserts.assert(o)) :
jspb.Message.clone_(/** @type {!Object} */(jspb.asserts.assert(o))) :
o;
}
}
Expand Down