Skip to content

Commit

Permalink
Remove noAssert (protobufjs#89)
Browse files Browse the repository at this point in the history
* Remove `noAssert` argument

The `noAssert` argument support dropped in the upcoming Node.js 10.x
release. This removes it therefore.

* Fix failing test

Asserting buffers with strictEqual is not possible. Those are
two different objects and can only be compared with deepStrictEqual
instead.
  • Loading branch information
BridgeAR authored and dcodeIO committed Mar 10, 2018
1 parent c5df326 commit 4144951
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/types/floats/float32.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ ByteBufferPrototype.writeFloat32 = function(value, offset) {
//? ENSURE_CAPACITY(4);
//? if (NODE) { // FIXME: Is there any way to inline the following in a sane way?
this.littleEndian
? this.buffer.writeFloatLE(value, offset, true)
: this.buffer.writeFloatBE(value, offset, true);
? this.buffer.writeFloatLE(value, offset)
: this.buffer.writeFloatBE(value, offset);
//? } else if (DATAVIEW)
this.view.setFloat32(offset, value, this.littleEndian);
//? else
Expand Down
8 changes: 4 additions & 4 deletions src/types/floats/float64.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ByteBufferPrototype.writeFloat64 = function(value, offset) {
//? ENSURE_CAPACITY(8);
//? if (NODE) {
this.littleEndian
? this.buffer.writeDoubleLE(value, offset, true)
: this.buffer.writeDoubleBE(value, offset, true);
? this.buffer.writeDoubleLE(value, offset)
: this.buffer.writeDoubleBE(value, offset);
//? } else if (DATAVIEW)
this.view.setFloat64(offset, value, this.littleEndian);
//? else
Expand Down Expand Up @@ -53,8 +53,8 @@ ByteBufferPrototype.readFloat64 = function(offset) {
}
//? if (NODE) {
var value = this.littleEndian
? this.buffer.readDoubleLE(offset, true)
: this.buffer.readDoubleBE(offset, true);
? this.buffer.readDoubleLE(offset)
: this.buffer.readDoubleBE(offset);
//? } else if (DATAVIEW)
var value = this.view.getFloat64(offset, this.littleEndian);
//? else
Expand Down
2 changes: 1 addition & 1 deletion tests/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function makeSuite(ByteBuffer) {
buf[0] = 0x01;
var bb = ByteBuffer.wrap(buf);
test.strictEqual(bb.capacity(), 1);
test.strictEqual(bb.buffer, buf);
test.deepStrictEqual(bb.buffer, buf);
test.strictEqual(bb.toDebug(), "<01>");
test.done();
};
Expand Down

0 comments on commit 4144951

Please sign in to comment.