Skip to content

Commit

Permalink
fixup! not resizable
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jul 11, 2024
1 parent 605e51f commit 2043b76
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/ses/src/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,15 @@ export const arrayBufferTransferToFixedLength =
// (avoiding the redundant allocation of e.g. `ArrayBuffer(newLength)`)
// and ToNumber through unary `+` (rather than `Number(newLength)`,
// which fails to reject BigInts).
//
// On platforms like Node 20
// - without`tranferToFixedLength` or `transfer`
// - with `structuredClone`
// - with `resize`
//
// It might seem like we could avoid the extra copy by
// `newBuffer.resize(newLength)`. But `structuredClone`
// makes ArrayBuffers that are not resizable.
return arrayBufferSlice(newBuffer, 0, newLength);
}
: /**
Expand Down

0 comments on commit 2043b76

Please sign in to comment.