diff options
author | Trevor Norris <trev.norris@gmail.com> | 2012-11-09 14:02:45 -0800 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-11-10 02:11:04 +0100 |
commit | 13c5db977190f926a213fc8ad7204e1febe36009 (patch) | |
tree | e802e2780bdaf424a05c44d7f9db4d64a3521b82 /lib | |
parent | 5e4e87ade5ad2dbf525865a3a94694dabb9b1d7f (diff) | |
download | android-node-v8-13c5db977190f926a213fc8ad7204e1febe36009.tar.gz android-node-v8-13c5db977190f926a213fc8ad7204e1febe36009.tar.bz2 android-node-v8-13c5db977190f926a213fc8ad7204e1febe36009.zip |
buffer: remove duplicate assertion tests
Many assertion tests are duplicated in buffer.js. These few could be easily
removed and still have all tests pass.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/buffer.js | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/lib/buffer.js b/lib/buffer.js index 2e1d6a045d..6c9753e888 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -1047,15 +1047,6 @@ Buffer.prototype.writeInt8 = function(value, offset, noAssert) { var buffer = this; if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to write beyond buffer length'); - verifsint(value, 0x7f, -0x80); } @@ -1068,18 +1059,6 @@ Buffer.prototype.writeInt8 = function(value, offset, noAssert) { function writeInt16(buffer, value, offset, isBigEndian, noAssert) { if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to write beyond buffer length'); - verifsint(value, 0x7fff, -0x8000); } @@ -1100,18 +1079,6 @@ Buffer.prototype.writeInt16BE = function(value, offset, noAssert) { function writeInt32(buffer, value, offset, isBigEndian, noAssert) { if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to write beyond buffer length'); - verifsint(value, 0x7fffffff, -0x80000000); } |