buffer: fix regression in Buffer(buf) constructor
authorBen Noordhuis <info@bnoordhuis.nl>
Fri, 23 Aug 2013 10:00:28 +0000 (12:00 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Fri, 23 Aug 2013 10:01:47 +0000 (12:01 +0200)
commitbc28acdd029687d24004f69f98617c7e171ca173
tree4e6938e28b51f8a3b5a11b18660aed1667a26914
parent546ae2eef90c4ef0eb30ef4f52402e3c45e2f3f2
buffer: fix regression in Buffer(buf) constructor

Commit 3a2f273b got the source and the target wrong when copying over
the data. Fix that and add a regression test.

Fixes #6111.
lib/buffer.js
test/simple/test-buffer.js