fix: make fetch/api/ strict mode compatible (#29240)
Co-authored-by: Philip Jägenstedt <philip@foolip.org>
diff --git a/fetch/api/basic/scheme-data.any.js b/fetch/api/basic/scheme-data.any.js
index 1c3b5dc..55df43b 100644
--- a/fetch/api/basic/scheme-data.any.js
+++ b/fetch/api/basic/scheme-data.any.js
@@ -3,7 +3,7 @@
function checkFetchResponse(url, data, mime, fetchMode, method) {
var cut = (url.length >= 40) ? "[...]" : "";
- desc = "Fetching " + (method ? "[" + method + "] " : "") + url.substring(0, 40) + cut + " is OK";
+ var desc = "Fetching " + (method ? "[" + method + "] " : "") + url.substring(0, 40) + cut + " is OK";
var init = {"method": method || "GET"};
if (fetchMode) {
init.mode = fetchMode;
diff --git a/fetch/api/basic/stream-safe-creation.any.js b/fetch/api/basic/stream-safe-creation.any.js
index 37c821c..382efc1 100644
--- a/fetch/api/basic/stream-safe-creation.any.js
+++ b/fetch/api/basic/stream-safe-creation.any.js
@@ -14,8 +14,8 @@
{method: 'POST', body: 'yes'}).arrayBuffer(),
};
-for (creationCase of Object.keys(creationCases)) {
- for (accessorName of ['start', 'type', 'size', 'highWaterMark']) {
+for (const creationCase of Object.keys(creationCases)) {
+ for (const accessorName of ['start', 'type', 'size', 'highWaterMark']) {
promise_test(async t => {
Object.defineProperty(Object.prototype, accessorName, {
get() { throw Error(`Object.prototype.${accessorName} was accessed`); },