8000 Fix toArrayBuffer offsets on slow path · protobufjs/bytebuffer.js@67c08d8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 67c08d8

Browse files
committed
Fix toArrayBuffer offsets on slow path
1 parent b300794 commit 67c08d8

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bytebuffer",
3-
"version": "3.5.1",
3+
"version": "3.5.2",
44
"author": "Daniel Wirtz <dcode@dcode.io>",
55
"description": "A full-featured ByteBuffer implementation using typed arrays.",
66
"main": "dist/ByteBufferAB.js",

dist/ByteBufferAB.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
* @const
117117
* @expose
118118
*/
119-
ByteBuffer.VERSION = "3.5.1";
119+
ByteBuffer.VERSION = "3.5.2";
120120

121121
/**
122122
* Little endian constant that can be used instead of its boolean value. Evaluates to `true`.

dist/ByteBufferAB.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ByteBufferAB.min.js.gz

0 Bytes
Binary file not shown.

dist/ByteBufferNB.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ module.exports = (function() {
108108
* @const
109109
* @expose
110110
*/
111-
ByteBuffer.VERSION = "3.5.1";
111+
ByteBuffer.VERSION = "3.5.2";
112112

113113
/**
114114
* Little endian constant that can be used instead of its boolean value. Evaluates to `true`.
@@ -2630,7 +2630,7 @@ module.exports = (function() {
26302630
} else { // Slow
26312631
var dst = new Uint8Array(ab);
26322632
for (var i=offset; i<limit; ++i) {
2633-
dst[i] = this.buffer[i];
2633+ dst[i-offset] = this.buffer[i];
26342634
}
26352635
}
26362636
return ab;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bytebuffer",
3-
"version": "3.5.1",
3+
"version": "3.5.2",
44
"author": "Daniel Wirtz <dcode@dcode.io>",
55
"description": "The swiss army knife for binary data in JavaScript.",
66
"main": "index.js",

src/methods/toBuffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ ByteBufferPrototype.toArrayBuffer = function() {
7373
} else { // Slow
7474
var dst = new Uint8Array(ab);
7575
for (var i=offset; i<limit; ++i) {
76-
dst[i] = this.buffer[i];
76+
dst[i-offset] = this.buffer[i];
7777
}
7878
}
7979
return ab;

0 commit comments

Comments
 (0)
0