!(b instanceof Buffer))
throw new TypeError('Arguments must be Buffers');
- return internal.compare(b, a);
+ return internal.compare(a, b);
};
assert.equal(d.compare(b), 1);
assert.equal(b.compare(d), -1);
-assert.equal(Buffer.compare(b, c), 1);
-assert.equal(Buffer.compare(c, d), -1);
-assert.equal(Buffer.compare(d, b), -1);
-assert.equal(Buffer.compare(b, d), 1);
+assert.equal(Buffer.compare(b, c), -1);
+assert.equal(Buffer.compare(c, d), 1);
+assert.equal(Buffer.compare(d, b), 1);
+assert.equal(Buffer.compare(b, d), -1);
assert.throws(function() {
var b = new Buffer(1);