1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

fix(ext/crypto): fix copying buffersource (#11714)

This commit is contained in:
Divy Srivastava 2021-08-15 15:30:35 +05:30 committed by GitHub
parent 4010b84675
commit 2d578ea54a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,8 +142,8 @@
const idlValue = normalizedAlgorithm[member]; const idlValue = normalizedAlgorithm[member];
// 3. // 3.
if (idlType === "BufferSource" && idlValue) { if (idlType === "BufferSource" && idlValue) {
normalizedAlgorithm[member] = new Uint8Array( normalizedAlgorithm[member] = TypedArrayPrototypeSlice(
TypedArrayPrototypeSlice( new Uint8Array(
(ArrayBufferIsView(idlValue) ? idlValue.buffer : idlValue), (ArrayBufferIsView(idlValue) ? idlValue.buffer : idlValue),
idlValue.byteOffset ?? 0, idlValue.byteOffset ?? 0,
idlValue.byteLength, idlValue.byteLength,