-
Notifications
You must be signed in to change notification settings - Fork 92
Editorial: separate TextDecoderStream constructor to two algos
#364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1851,23 +1851,31 @@ constructor steps are: | |
|
|
||
| <li><p>If <var>encoding</var> is failure or <a>replacement</a>, then <a>throw</a> a {{RangeError}}. | ||
|
|
||
| <li><p>Set <a>this</a>'s <a for=TextDecoderCommon>encoding</a> to <var>encoding</var>. | ||
| <li><p>Let <var>errorMode</var> be <code>fatal</code> if <var>options</var>["{{TextDecoderOptions/fatal}}"] is true; otherwise <code>replacement</code>. | ||
|
|
||
| <li><p>If <var>options</var>["{{TextDecoderOptions/fatal}}"] is true, then set <a>this</a>'s | ||
| <a for=TextDecoderCommon>error mode</a> to "<code>fatal</code>". | ||
| <li><p>Let <var>ignoreBOM</var> be true if <var>options</var>["{{TextDecoderOptions/ignoreBOM}}"] is true; otherwise false. | ||
|
noamr marked this conversation as resolved.
Outdated
|
||
|
|
||
| <li><p>Set <a>this</a>'s <a for=TextDecoderCommon>ignore BOM</a> to | ||
| <var>options</var>["{{TextDecoderOptions/ignoreBOM}}"]. | ||
| <li><p>Call <a>set up a text decoder stream</a> with <a>this</a>, <var>encoding</var>, <var>errorMode</var>, and <var>ignoreBOM</var>. | ||
|
noamr marked this conversation as resolved.
Outdated
|
||
|
|
||
| </ol> | ||
| </div> | ||
|
|
||
| <li><p>Set <a>this</a>'s <a for=TextDecoderCommon>decoder</a> to a new instance of <a>this</a>'s | ||
| <a for=TextDecoderCommon>encoding</a>'s <a for=/>decoder</a>, and set <a>this</a>'s | ||
| <a for=TextDecoderCommon>I/O queue</a> to a new <a for=/>I/O queue</a>. | ||
| <div algorithm> | ||
| <p>To <dfn export>set up a text decoder stream</dfn> <var>stream</var>, given an optional [=/encoding=] <var>encoding</var> (default <a>UTF-8</a>), | ||
|
noamr marked this conversation as resolved.
Outdated
|
||
| an optional <a for=/>error mode</a> <var>errorMode</var> (default <code>replacement</code>), and an optional boolean <var>ignoreBOM</var> (default false), run these steps: | ||
|
noamr marked this conversation as resolved.
Outdated
|
||
|
|
||
| <ol> | ||
|
noamr marked this conversation as resolved.
|
||
| <li><p>Set <var>stream</var>'s <a for=TextDecoderCommon>encoding</a> to <var>encoding</var>. | ||
|
|
||
| <li><p>Set <var>stream</var>'s <a for=TextDecoderCommon>error mode</a> to <var>errorMode</var>. | ||
|
|
||
| <li><p>Set <var>stream</var>'s <a for=TextDecoderCommon>ignore BOM</a> to <var>ignoreBOM</var>. | ||
|
|
||
| <li><p>Let <var>transformAlgorithm</var> be an algorithm which takes a <var>chunk</var> argument | ||
| and runs the <a>decode and enqueue a chunk</a> algorithm with <a>this</a> and <var>chunk</var>. | ||
| and runs the <a>decode and enqueue a chunk</a> algorithm with <var>stream</var> and <var>chunk</var>. | ||
|
|
||
| <li><p>Let <var>flushAlgorithm</var> be an algorithm which takes no arguments and runs the | ||
| <a>flush and enqueue</a> algorithm with <a>this</a>. | ||
| <a>flush and enqueue</a> algorithm with <var>stream</var>. | ||
|
|
||
| <li><p>Let <var>transformStream</var> be a [=new=] {{TransformStream}}. | ||
|
|
||
|
|
@@ -1877,7 +1885,11 @@ constructor steps are: | |
| <a for="TransformStream/set up"><var ignore>flushAlgorithm</var></a> set to | ||
| <var>flushAlgorithm</var>. | ||
|
|
||
| <li><p>Set <a>this</a>'s <a for=GenericTransformStream>transform</a> to <var>transformStream</var>. | ||
| <li><p>Set <var>stream</var>'s <a for=TextDecoderCommon>decoder</a> to a new instance of <var>encoding</var>'s <a for=/>decoder</a>. | ||
|
|
||
| <li><p>Set <var>stream</var>'s <a for=TextDecoderCommon>I/O queue</a> to a new <a for=/>I/O queue</a>. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason to move these two steps further down? Making them separate steps makes sense, but it would be nicer for the diff if they are in the same place still.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
|
||
| <li><p>Set <var>stream</var>'s <a for=GenericTransformStream>transform</a> to <var>transformStream</var>. | ||
| </ol> | ||
| </div> | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.