Skip to content

Commit d0b650a

Browse files
Address some comments.
1 parent b997a56 commit d0b650a

File tree

1 file changed

+15
-25
lines changed

1 file changed

+15
-25
lines changed

index.bs

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -569,56 +569,46 @@ It must act as follows:
569569
</pre>
570570
</div>
571571

572-
<h4 id="stream-method-algo">
573-
The stream method</h4>
572+
### The {{Blob/stream()}} method ### {#stream-method-algo}
574573

575-
The <dfn method for=Blob>stream()</dfn> method returns the contents
576-
of the blob as a {{ReadableStream}}.
577-
578-
It must return the result of [=getting a stream for a Blob=] for the [=context object=].
574+
The <dfn method for=Blob>stream()</dfn> method, when invoked, must return
575+
the result of [=getting a stream for a Blob=] for the [=context object=].
579576

580577
To <dfn lt="get a stream for a Blob|getting a stream for a Blob">get a stream for a {{Blob}}</dfn>
581578
|blob|, run the following steps:
582579

583580
1. Let |stream| be the result of [=construct a ReadableStream object|constructing=] a
584581
{{ReadableStream}} object.
585-
1. Return |stream| and run the following steps [=in parallel=]:
582+
1. Run the following steps [=in parallel=]:
586583
1. While not all bytes of |blob| have been read:
587584
1. Let |bytes| be the byte sequence that results from reading a [=chunk=] from |blob|.
588585
1. If a [=file read error=] occured while reading |bytes|, [$ReadableStream/error$]
589586
|stream| with a [=failure reason=] and abort these steps.
590587
1. [=ReadableStream/Enqueue=] |bytes| into |stream|.
591588

592-
Issue: We need to specify more concretely what reading from a Blob actually does, and what
593-
possible errors can happen.
594-
595-
<h4 id="text-method-algo">
596-
The text method</h4>
589+
Issue: We need to specify more concretely what reading from a Blob actually does,
590+
and what possible errors can happen.
591+
1. Return |stream|.
597592

598-
The <dfn method for=Blob>text()</dfn> method returns the contents
599-
of the blob as a {{USVString}}.
593+
### The {{Blob/text()}} method ### {#text-method-algo}
600594

601-
It must act as follows:
595+
The <dfn method for=Blob>text()</dfn> method, when invoked, must run these steps:
602596

603597
1. Let |stream| be the the result of [=getting a stream for a Blob=] for the [=context object=].
604-
1. Let |reader| be the result of [=getting a reader=] from |stream|.
598+
1. Let |reader| be the result of [=get a reader|getting a reader=] from |stream|.
605599
If that threw an exception, return a new promise rejected with that exception.
606-
1. Let |promise| be the result of [=reading all bytes=] from |stream| with |reader|.
600+
1. Let |promise| be the result of [=read all bytes|reading all bytes=] from |stream| with |reader|.
607601
1. Return the result of transforming |promise| by a fulfillment handler that returns the result of
608602
running [=UTF-8 decode=] on its first argument.
609603

610-
<h4 id="arraybuffer-method-algo">
611-
The arrayBuffer method</h4>
612-
613-
The <dfn method for=Blob>arrayBuffer()</dfn> method returns the contents
614-
of the blob as an {{ArrayBuffer}}.
604+
### The {{Blob/arrayBuffer()}} method ### {#arraybuffer-method-algo}
615605

616-
It must act as follows:
606+
The <dfn method for=Blob>arrayBuffer()</dfn> method, when invoked, must run these steps:
617607

618608
1. Let |stream| be the the result of [=getting a stream for a Blob=] for the [=context object=].
619-
1. Let |reader| be the result of [=getting a reader=] from |stream|.
609+
1. Let |reader| be the result of [=get a reader|getting a reader=] from |stream|.
620610
If that threw an exception, return a new promise rejected with that exception.
621-
1. Let |promise| be the result of [=reading all bytes=] from |stream| with |reader|.
611+
1. Let |promise| be the result of [=read all bytes|reading all bytes=] from |stream| with |reader|.
622612
1. Return the result of transforming |promise| by a fulfillment handler that returns
623613
a new {{ArrayBuffer} whose contents are its first argument.
624614

0 commit comments

Comments
 (0)