Skip to content

Commit

Permalink
Use the current realm for Response's static methods
Browse files Browse the repository at this point in the history
Fixes #1603.
  • Loading branch information
annevk committed May 8, 2023
1 parent b07a52c commit 13cb7c9
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ urlPrefix:https://w3c.github.io/hr-time/#;spec:hr-time
urlPrefix:https://tc39.es/ecma262/#;type:dfn;spec:ecma-262
url:realm;text:realm
url:sec-list-and-record-specification-type;text:Record
url:current-realm;text:current realm
</pre>

<pre class=biblio>
Expand Down Expand Up @@ -7804,13 +7805,13 @@ constructor steps are:
<li><p>Set <a>this</a>'s <a for=Request>request</a> to <var>request</var>.

<li><p>Set <a>this</a>'s <a for=Request>signal</a> to a <a for=/>new</a> {{AbortSignal}} object
with <a>this</a>'s <a>relevant Realm</a>.
with <a>this</a>'s <a>relevant realm</a>.

<li><p>If <var>signal</var> is non-null, then make <a>this</a>'s <a for=Request>signal</a>
<a for=AbortSignal>follow</a> <var>signal</var>.

<li><p>Set <a>this</a>'s <a for=Request>headers</a> to a <a for=/>new</a> {{Headers}} object with
<a>this</a>'s <a>relevant Realm</a>, whose <a for=Headers>header list</a> is <var>request</var>'s
<a>this</a>'s <a>relevant realm</a>, whose <a for=Headers>header list</a> is <var>request</var>'s
<a for=request>header list</a> and <a for=Headers>guard</a> is "<code>request</code>".

<li>
Expand Down Expand Up @@ -7994,7 +7995,7 @@ set; otherwise false.

<li><p>Let <var>clonedRequestObject</var> be the result of <a for=Request>creating</a> a
{{Request}} object, given <var>clonedRequest</var>, <a>this</a>'s
<a for=Request>headers</a>'s <a for=Headers>guard</a>, and <a>this</a>'s <a>relevant Realm</a>.
<a for=Request>headers</a>'s <a for=Headers>guard</a>, and <a>this</a>'s <a>relevant realm</a>.

<li><p>Make <var>clonedRequestObject</var>'s <a for=Request>signal</a>
<a for=AbortSignal>follow</a> <a>this</a>'s <a for=Request>signal</a>.
Expand Down Expand Up @@ -8171,7 +8172,7 @@ constructor steps are:
<li><p>Set <a>this</a>'s <a for=Response>response</a> to a new <a for=/>response</a>.

<li><p>Set <a>this</a>'s <a for=Response>headers</a> to a <a for=/>new</a> {{Headers}} object with
<a>this</a>'s <a>relevant Realm</a>, whose <a for=Headers>header list</a> is <a>this</a>'s
<a>this</a>'s <a>relevant realm</a>, whose <a for=Headers>header list</a> is <a>this</a>'s
<a for=Response>response</a>'s <a for=response>header list</a> and <a for=Headers>guard</a> is
"<code>response</code>".

Expand All @@ -8187,7 +8188,7 @@ constructor steps are:

<p>The static <dfn method for=Response><code>error()</code></dfn> method steps are to return the
result of <a for=Response>creating</a> a {{Response}} object, given a new <a>network error</a>,
"<code>immutable</code>", and <a>this</a>'s <a>relevant Realm</a>.
"<code>immutable</code>", and the <a>current realm</a>.

<div algorithm>
<p>The static
Expand All @@ -8203,8 +8204,7 @@ are:
<li><p>If <var>status</var> is not a <a>redirect status</a>, then <a>throw</a> a {{RangeError}}.

<li><p>Let <var>responseObject</var> be the result of <a for=Response>creating</a> a {{Response}}
object, given a new <a for=/>response</a>, "<code>immutable</code>", and <a>this</a>'s
<a>relevant Realm</a>.
object, given a new <a for=/>response</a>, "<code>immutable</code>", and the <a>current realm</a>.

<li><p>Set <var>responseObject</var>'s <a for=Response>response</a>'s <a for=response>status</a> to
<var>status</var>.
Expand Down Expand Up @@ -8232,8 +8232,7 @@ are:
<li><p>Let <var>body</var> be the result of <a for=BodyInit>extracting</a> <var>bytes</var>.

<li><p>Let <var>responseObject</var> be the result of <a for=Response>creating</a> a {{Response}}
object, given a new <a for=/>response</a>, "<code>response</code>", and <a>this</a>'s
<a>relevant Realm</a>.
object, given a new <a for=/>response</a>, "<code>response</code>", and the <a>current realm</a>.

<li><p>Perform <a>initialize a response</a> given <var>responseObject</var>, <var>init</var>, and
(<var>body</var>, "<code>application/json</code>").
Expand Down Expand Up @@ -8285,7 +8284,7 @@ otherwise false.

<li><p>Return the result of <a for=Response>creating</a> a {{Response}} object, given
<var>clonedResponse</var>, <a>this</a>'s <a for=Response>headers</a>'s <a for=Headers>guard</a>,
and <a>this</a>'s <a>relevant Realm</a>.
and <a>this</a>'s <a>relevant realm</a>.
</ol>
</div>

Expand Down Expand Up @@ -8331,7 +8330,7 @@ method steps are:

<li><p>Let <var>responseObject</var> be null.

<li><p>Let <var>relevantRealm</var> be <a>this</a>'s <a>relevant Realm</a>.
<li><p>Let <var>relevantRealm</var> be <a>this</a>'s <a>relevant realm</a>.

<li>
<p>Let <var>locallyAborted</var> be false.
Expand Down

0 comments on commit 13cb7c9

Please sign in to comment.