Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine function with prototype function #170

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
14 changes: 1 addition & 13 deletions binary/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jspb.BinaryReader.getInstanceCacheLength = function() {
* @return {!jspb.BinaryReader}
* @export
*/
jspb.BinaryReader.alloc = function(opt_bytes, opt_start, opt_length) {
jspb.BinaryReader.prototype.alloc = function(opt_bytes, opt_start, opt_length) {
if (jspb.BinaryReader.instanceCache_.length) {
var newReader = jspb.BinaryReader.instanceCache_.pop();
if (opt_bytes) {
Expand All @@ -152,18 +152,6 @@ jspb.BinaryReader.alloc = function(opt_bytes, opt_start, opt_length) {
};


/**
* Alias for the above method.
* @param {jspb.ByteSource=} opt_bytes The bytes we're reading from.
* @param {number=} opt_start The optional offset to start reading at.
* @param {number=} opt_length The optional length of the block to read -
* we'll throw an assertion if we go off the end of the block.
* @return {!jspb.BinaryReader}
* @export
*/
jspb.BinaryReader.prototype.alloc = jspb.BinaryReader.alloc;


/**
* Puts this instance back in the instance cache.
* @export
Expand Down