From 4144951c7f583d9394d18487ff0b2b7474b1e775 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Sat, 10 Mar 2018 23:18:08 +0100 Subject: [PATCH] Remove `noAssert` (#89) * 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. --- src/types/floats/float32.js | 4 ++-- src/types/floats/float64.js | 8 ++++---- tests/suite.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/types/floats/float32.js b/src/types/floats/float32.js index ab5f4a7..a9208ae 100644 --- a/src/types/floats/float32.js +++ b/src/types/floats/float32.js @@ -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 diff --git a/src/types/floats/float64.js b/src/types/floats/float64.js index 30b3041..5a2584c 100644 --- a/src/types/floats/float64.js +++ b/src/types/floats/float64.js @@ -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 @@ -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 diff --git a/tests/suite.js b/tests/suite.js index d8d7f4b..6de8c55 100644 --- a/tests/suite.js +++ b/tests/suite.js @@ -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(); };