Skip to content

Commit 10e01c1

Browse files
author
Daniel Wirtz
committed
Fixed toBuffer, rebuild, #2 ?
1 parent 75b8700 commit 10e01c1

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

ByteBuffer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,10 +1948,10 @@
19481948
offset = length;
19491949
length = temp;
19501950
}
1951-
return new Buffer(new Uint8Array(this.array).subarray(offset, length));
1951+
var srcView = new Uint8Array(this.array);
1952+
return new Buffer(srcView.subarray(offset, length));
19521953
} catch (e) {
1953-
console.trace(e);
1954-
throw("ByteBuffer#toBuffer() is available with node.js only");
1954+
throw(e);
19551955
}
19561956
};
19571957

ByteBuffer.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ByteBuffer.min.map

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

ByteBuffer.noexpose.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,10 +1845,10 @@
18451845
offset = length;
18461846
length = temp;
18471847
}
1848-
return new Buffer(new Uint8Array(this.array).subarray(offset, length));
1848+
var srcView = new Uint8Array(this.array);
1849+
return new Buffer(srcView.subarray(offset, length));
18491850
} catch (e) {
1850-
console.trace(e);
1851-
throw("ByteBuffer#toBuffer() is available with node.js only");
1851+
throw(e);
18521852
}
18531853
};
18541854

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": "1.3.1",
3+
"version": "1.3.2",
44
"author": "Daniel Wirtz <[email protected]>",
55
"description": "ByteBuffer.js: A Java-like, Netty-inspired ByteBuffer implementation using typed arrays.",
66
"main": "ByteBuffer.js",

src/ByteBuffer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,10 +1948,10 @@
19481948
offset = length;
19491949
length = temp;
19501950
}
1951-
return new Buffer(new Uint8Array(this.array).subarray(offset, length));
1951+
var srcView = new Uint8Array(this.array);
1952+
return new Buffer(srcView.subarray(offset, length));
19521953
} catch (e) {
1953-
console.trace(e);
1954-
throw("ByteBuffer#toBuffer() is available with node.js only");
1954+
throw(e);
19551955
}
19561956
};
19571957

0 commit comments

Comments
 (0)