Skip to content

Commit

Permalink
Fetch: Request duplex property
Browse files Browse the repository at this point in the history
  • Loading branch information
jakearchibald authored Sep 26, 2022
1 parent ff5f12e commit 8fdd0c4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions fetch/api/request/request-structure.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ var attributes = ["method",
"integrity",
"isReloadNavigation",
"isHistoryNavigation",
"duplex",
//Request implements Body
"bodyUsed"
];

function IsreadOnly(request, attributeToCheck) {
function isReadOnly(request, attributeToCheck) {
var defaultValue = undefined;
var newValue = undefined;
switch (attributeToCheck) {
Expand All @@ -46,7 +47,6 @@ function IsreadOnly(request, attributeToCheck) {
request.headers = new Headers ({"name":"value"});
assert_false(request.headers.has("name"), "Headers attribute is read only");
return;
break;

case "destination":
defaultValue = "";
Expand Down Expand Up @@ -102,6 +102,11 @@ function IsreadOnly(request, attributeToCheck) {
newValue = true;
break;

case "duplex":
defaultValue = "half";
newValue = "full";
break;

default:
return;
}
Expand All @@ -123,6 +128,6 @@ for (var idx in methods) {
for (var idx in attributes) {
test(function() {
assert_true(attributes[idx] in request, "request has " + attributes[idx] + " attribute");
IsreadOnly(request, attributes[idx]);
isReadOnly(request, attributes[idx]);
}, "Check " + attributes[idx] + " attribute");
}

0 comments on commit 8fdd0c4

Please sign in to comment.