Permalink
Browse files

Make observability examples nitpick-proof

Also clean up some editorial issues with that section in general.

Fixes #625.
  • Loading branch information...
domenic authored and annevk committed Dec 1, 2017
1 parent a1d387c commit 00b131d30d2dd664c3d8068b321581fc2f9700da
Showing with 6 additions and 3 deletions.
  1. +6 −3 fetch.bs
View
@@ -5758,15 +5758,15 @@ method, must run these steps:
<h3 id=garbage-collection>Garbage collection</h3>
<p>The user agent may <a lt=terminated for=fetch>terminate</a> an ongoing fetch with if that
termination is not observable through script.
<p>The user agent may <a lt=terminated for=fetch>terminate</a> an ongoing fetch if that termination
is not observable through script.
<p class="note no-backref">"Observable through script" means observable through
<a><code>fetch()</code></a>'s arguments and return value. Other ways, such as
communicating with the server through a side-channel are not included.
<p class="note no-backref">The server being able to observe garbage collection has precedent, e.g.,
with <code>WebSocket</code> and <code>XMLHttpRequest</code> objects.
with {{WebSocket}} and {{XMLHttpRequest}} objects.
<div id=terminate-examples class="example no-backref">
<p>The user agent can terminate the fetch because the termination cannot be observed.
@@ -5799,6 +5799,9 @@ fetch("https://www.example.com/")
.then(res => {
res.body.getReader().closed.then(() => console.log("stream closed!"))
})</pre>
<p>(The above examples of non-observability assume that built-in properties and functions, such as
{{ReadableStream/getReader()|body.getReader()}}, have not been overwritten.)
</div>

0 comments on commit 00b131d

Please sign in to comment.