Skip to content

Commit

Permalink
Merge pull request #4240 from w3c/annevk/fetch-headersinit-idl-changes
Browse files Browse the repository at this point in the history
Reflect HeadersInit changes
  • Loading branch information
youennf authored Nov 24, 2016
2 parents 669cb2b + 3217584 commit f7cc6a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion fetch/api/headers/headers-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
assert_equals(headers.get(name), String(headerDict[name]),
"name: " + name + " has value: " + headerDict[name]);
}
}, "Create headers with OpenEndedDictionary");
}, "Create headers with record");

test(function() {
var headers = new Headers(headerDict);
Expand All @@ -68,6 +68,14 @@
}
}, "Create headers with existing headers");

test(function() {
var headers = new Headers({test:"test"});
var headers2 = new Headers()
headers2[Symbol.iterator] = headers[Symbol.iterator]
var headers3 = new Headers(headers2)
assert_equals(headers3.get("test"), "test")
}, "Create headers with existing headers with custom iterator");

test(function() {
var headers = new Headers();
for (name in headerDict) {
Expand Down
2 changes: 1 addition & 1 deletion fetch/api/headers/headers-idl.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</head>
<body>
<script id="headers-idl" type="text/plain">
typedef (Headers or sequence<sequence<ByteString>> or OpenEndedDictionary<ByteString>) HeadersInit;
typedef (sequence<sequence<ByteString>> or record<ByteString>) HeadersInit;

[Constructor(optional HeadersInit init),
Exposed=(Window,Worker)]
Expand Down

0 comments on commit f7cc6a4

Please sign in to comment.