Skip to content

Commit a5b268e

Browse files
committed
fix compat issue
1 parent 1502f5c commit a5b268e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/buffer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,12 @@ Buffer.concat = function concat(list, length) {
615615
if (toCopy === bufLength) {
616616
TypedArrayPrototypeSet(buffer, buf, pos);
617617
} else {
618-
TypedArrayPrototypeSet(buffer, TypedArrayPrototypeSubarray(buf, 0, toCopy), pos);
618+
const src = new Uint8Array(
619+
TypedArrayPrototypeGetBuffer(buf),
620+
TypedArrayPrototypeGetByteOffset(buf),
621+
toCopy,
622+
);
623+
TypedArrayPrototypeSet(buffer, src, pos);
619624
}
620625
pos += toCopy;
621626
}

0 commit comments

Comments
 (0)