Add deep clone test for buffers.

This commit is contained in:
John-David Dalton
2016-02-06 00:06:43 -08:00
parent 8810754ada
commit 984b0af883
2 changed files with 7 additions and 4 deletions

View File

@@ -2252,7 +2252,7 @@
isFunc = tag == funcTag || tag == genTag;
if (isBuffer(value)) {
return cloneBuffer(value);
return cloneBuffer(value, isDeep);
}
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
if (isHostObject(value)) {
@@ -3719,7 +3719,7 @@
* @returns {Buffer} Returns the cloned buffer.
*/
function cloneBuffer(buffer, isDeep) {
if (!isDeep) {
if (isDeep) {
return buffer.slice();
}
var Ctor = buffer.constructor,