Skip to content

Commit

Permalink
fix validateStreamFromPartialString test utility (#29517)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato authored Jun 28, 2021
1 parent 308d331 commit 238ad66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fetch/api/resources/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function validateStreamFromString(reader, expectedValue, retrievedArrayBuffer) {
assert_true(data.value instanceof Uint8Array, "Fetch ReadableStream chunks should be Uint8Array");
var newBuffer;
if (retrievedArrayBuffer) {
newBuffer = new ArrayBuffer(data.value.length + retrievedArrayBuffer.length);
newBuffer = new Uint8Array(data.value.length + retrievedArrayBuffer.length);
newBuffer.set(retrievedArrayBuffer, 0);
newBuffer.set(data.value, retrievedArrayBuffer.length);
} else {
Expand All @@ -80,7 +80,7 @@ function validateStreamFromPartialString(reader, expectedValue, retrievedArrayBu
assert_true(data.value instanceof Uint8Array, "Fetch ReadableStream chunks should be Uint8Array");
var newBuffer;
if (retrievedArrayBuffer) {
newBuffer = new ArrayBuffer(data.value.length + retrievedArrayBuffer.length);
newBuffer = new Uint8Array(data.value.length + retrievedArrayBuffer.length);
newBuffer.set(retrievedArrayBuffer, 0);
newBuffer.set(data.value, retrievedArrayBuffer.length);
} else {
Expand Down

0 comments on commit 238ad66

Please sign in to comment.