Skip to content

Commit b510ba2

Browse files
committed
Can't use Uint8Array#set on node < 6 buffers
1 parent c3c70fe commit b510ba2

6 files changed

+13
-17
lines changed

dist/protobuf.js

+5-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.min.js.gz

-8 Bytes
Binary file not shown.

dist/protobuf.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/writer.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -602,12 +602,10 @@ BufferWriterPrototype.double = function write_double_buffer(value) {
602602
return this.push(writeDoubleBuffer, 8, value);
603603
};
604604

605-
var writeBytesBuffer = util.Buffer && util.Buffer.prototype.set // set is faster (node 6.9.1)
606-
? writeBytes_set
607-
: function writeBytes_copy(buf, pos, val) {
608-
if (val.length)
609-
val.copy(buf, pos, 0, val.length);
610-
};
605+
function writeBytesBuffer(buf, pos, val) {
606+
if (val.length)
607+
val.copy(buf, pos, 0, val.length);
608+
};
611609

612610
/**
613611
* @override

0 commit comments

Comments
 (0)