8000 Resolve ReferenceError in BBNB#toBuffer(true), fixes #35 · ExodusMovement/bytebuffer.js@0a5d362 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0a5d362

Browse files
committed
Resolve ReferenceError in BBNB#toBuffer(true), fixes protobufjs#35
1 parent 28c246e commit 0a5d362

File tree

9 files changed

+17
-20
lines changed

9 files changed

+17
-20
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.3",
3+
"version": "3.5.4",
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: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
* @const
117117
* @expose
118118
*/
119-
ByteBuffer.VERSION = "3.5.3";
119+
ByteBuffer.VERSION = "3.5.4";
120120

121121
/**
122122
* Little endian constant that can be used instead of its boolean value. Evaluates to `true`.
@@ -2136,11 +2136,10 @@
21362136
if (begin < 0 || begin > end || end > this.buffer.byteLength)
21372137
throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
21382138
}
2139-
if (begin >= end) return this; // Nothing to fill
2139+
if (begin >= end)
2140+
return this; // Nothing to fill
21402141
while (begin < end) this.view.setUint8(begin++, value);
2141-
if (relative) {
2142-
this.offset = begin;
2143-
}
2142+
if (relative) this.offset = begin;
21442143
return this;
21452144
};
21462145

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/ByteBufferAB.min.map

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/ByteBufferNB.js

Lines changed: 5 additions & 6 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.3";
111+
ByteBuffer.VERSION = "3.5.4";
112112

113113
/**
114114
* Little endian constant that can be used instead of its boolean value. Evaluates to `true`.
@@ -2285,12 +2285,11 @@ module.exports = (function() {
22852285
if (begin < 0 || begin > end || end > this.buffer.length)
22862286
throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.length);
22872287
}
2288-
if (begin >= end) return this; // Nothing to fill
2288+
if (begin >= end)
2289+
return this; // Nothing to fill
22892290
this.buffer.fill(value, begin, end);
22902291
begin = end;
2291-
if (relative) {
2292-
this.offset = begin;
2293-
}
2292+
if (relative) this.offset = begin;
22942293
return this;
22952294
};
22962295

@@ -2590,7 +2589,7 @@ module.exports = (function() {
25902589
if (forceCopy) {
25912590
var buffer = new Buffer(limit - offset);
25922591
this.buffer.copy(buffer, 0, offset, limit);
2593-
return b;
2592+
return buffer;
25942593
} else {
25952594
if (offset === 0 && limit === this.buffer.length)
25962595
return this.buffer;

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.3",
3+
"version": "3.5.4",
44
"author": "Daniel Wirtz <dcode@dcode.io>",
55
"description": "The swiss army knife for binary data in JavaScript.",
66
"main": "index.js",

src/methods/fill.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ ByteBufferPrototype.fill = function(value, begin, end) {
1919
//? ASSERT_INTEGER('value');
2020
//? ASSERT_RANGE();
2121
}
22-
if (begin >= end) return this; // Nothing to fill
22+
if (begin >= end)
23+
return this; // Nothing to fill
2324
//? if (NODE) {
2425
this.buffer.fill(value, begin, end);
2526
begin = end;
2627
//? } else {
2728
while (begin < end) this.view.setUint8(begin++, value);
2829
//? }
29-
if (relative) {
30-
this.offset = begin;
31-
}
30+
if (relative) this.offset = begin;
3231
return this;
3332
};
3433

src/methods/toBuffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ByteBufferPrototype.toBuffer = function(forceCopy) {
2626
if (forceCopy) {
2727
var buffer = new Buffer(limit - offset);
2828
this.buffer.copy(buffer, 0, offset, limit);
29-
return b;
29+
return buffer;
3030
} else {
3131
if (offset === 0 && limit === this.buffer.length)
3232
return this.buffer;

0 commit comments

Comments
 (0)
0