summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/web/06_streams.js6
-rw-r--r--tools/wpt/expectation.json2
2 files changed, 8 insertions, 0 deletions
diff --git a/ext/web/06_streams.js b/ext/web/06_streams.js
index 933d7b09c..361e5e055 100644
--- a/ext/web/06_streams.js
+++ b/ext/web/06_streams.js
@@ -813,6 +813,12 @@
const { value: chunk, done } = await reader.read();
if (done) break;
+ if (!ObjectPrototypeIsPrototypeOf(Uint8ArrayPrototype, chunk)) {
+ throw new TypeError(
+ "Can't convert value to Uint8Array while consuming the stream",
+ );
+ }
+
ArrayPrototypePush(chunks, chunk);
totalLength += chunk.byteLength;
}
diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json
index e9dfa03d0..558ada79a 100644
--- a/tools/wpt/expectation.json
+++ b/tools/wpt/expectation.json
@@ -3003,6 +3003,8 @@
"response-static-error.any.worker.html": true,
"response-static-redirect.any.html": true,
"response-static-redirect.any.worker.html": true,
+ "response-stream-bad-chunk.any.html": true,
+ "response-stream-bad-chunk.any.worker.html": true,
"response-stream-disturbed-1.any.html": true,
"response-stream-disturbed-1.any.worker.html": true,
"response-stream-disturbed-2.any.html": true,