Skip to content

Commit

Permalink
Align with IDL constructor changes
Browse files Browse the repository at this point in the history
Fixes #929.
  • Loading branch information
autokagami authored and annevk committed Sep 24, 2019
1 parent 8e1f341 commit eff7659
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions fetch.bs
Expand Up @@ -5152,16 +5152,18 @@ fetch("/music/pk/altes-kamuffel.flac")
<pre class=idl>
typedef (sequence&lt;sequence&lt;ByteString>> or record&lt;ByteString, ByteString>) HeadersInit;

[Constructor(optional HeadersInit init),
Exposed=(Window,Worker)]
[Exposed=(Window,Worker)]
interface Headers {
constructor(optional HeadersInit init);

void append(ByteString name, ByteString value);
void delete(ByteString name);
ByteString? get(ByteString name);
boolean has(ByteString name);
void set(ByteString name, ByteString value);
iterable&lt;ByteString, ByteString>;
};</pre>
};
</pre>

<p class=note>Unlike a <a for=/>header list</a>, a {{Headers}} object cannot represent more than one
`<code>Set-Cookie</code>` <a for=/>header</a>. In a way this is problematic as unlike all other
Expand Down Expand Up @@ -5689,9 +5691,10 @@ invoked, must return the result of running
<pre class=idl>
typedef (Request or USVString) RequestInfo;

[Constructor(RequestInfo input, optional RequestInit init = {}),
Exposed=(Window,Worker)]
[Exposed=(Window,Worker)]
interface Request {
constructor(RequestInfo input, optional RequestInit init = {});

readonly attribute ByteString method;
readonly attribute USVString url;
[SameObject] readonly attribute Headers headers;
Expand Down Expand Up @@ -5733,7 +5736,8 @@ enum RequestDestination { "", "audio", "audioworklet", "document", "embed", "fon
enum RequestMode { "navigate", "same-origin", "no-cors", "cors" };
enum RequestCredentials { "omit", "same-origin", "include" };
enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };
enum RequestRedirect { "follow", "error", "manual" };</pre>
enum RequestRedirect { "follow", "error", "manual" };
</pre>

<p class="note no-backref">"<code>serviceworker</code>" is omitted from
<a enum><code>RequestDestination</code></a> as it cannot be observed from JavaScript. Implementations
Expand Down Expand Up @@ -6336,9 +6340,10 @@ run these steps:

<h3 id=response-class>Response class</h3>

<pre class=idl>[Constructor(optional BodyInit? body = null, optional ResponseInit init = {}),
Exposed=(Window,Worker)]
<pre class=idl>[Exposed=(Window,Worker)]
interface Response {
constructor(optional BodyInit? body = null, optional ResponseInit init = {});

[NewObject] static Response error();
[NewObject] static Response redirect(USVString url, optional unsigned short status = 302);

Expand All @@ -6362,7 +6367,8 @@ dictionary ResponseInit {
HeadersInit headers;
};

enum ResponseType { "basic", "cors", "default", "error", "opaque", "opaqueredirect" };</pre>
enum ResponseType { "basic", "cors", "default", "error", "opaque", "opaqueredirect" };
</pre>

<p>A {{Response}} object has an associated
<dfn id=concept-response-response for=Response export>response</dfn> (a
Expand Down Expand Up @@ -6559,8 +6565,9 @@ run these steps:

<pre class=idl>
partial interface mixin WindowOrWorkerGlobalScope {
[NewObject] Promise&lt;Response> fetch(RequestInfo input, optional RequestInit init);
};</pre>
[NewObject] Promise&lt;Response> fetch(RequestInfo input, optional RequestInit init = {});
};
</pre>

<p>The
<dfn id=dom-global-fetch method for=WindowOrWorkerGlobalScope><code>fetch(<var>input</var>, <var>init</var>)</code></dfn>
Expand Down

0 comments on commit eff7659

Please sign in to comment.