Skip to content

Commit

Permalink
Make TextDecoderStream accept ArrayBufferView types
Browse files Browse the repository at this point in the history
  • Loading branch information
ricea committed Aug 7, 2018
1 parent f04369c commit 6a65ad5
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions encoding.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1484,10 +1484,26 @@ byteReadable
{{TextDecoderStream}} <var>dec</var> and a <var>chunk</var>, runs these steps:

<ol>
<li><p>If <a>Type</a>(<var>chunk</var>) is not Object, or <var>chunk</var> does not have an
\[[ArrayBufferData]] internal slot, or <a abstract-op>IsDetachedBuffer</a>(<var>chunk</var>) is
true, or <a abstract-op>IsSharedArrayBuffer</a>(<var>chunk</var>) is true, then return a new
promise rejected with a {{TypeError}} exception.
<li><p>If <a>Type</a>(<var>chunk</var>) is not Object, then return a new promise rejected with a
{{TypeError}} exception.

<li><p>Let <var>arrayBuffer</var> be <var>chunk</var>.

<li>
<p>If <var>arrayBuffer</var> has an \[[ViewedArrayBuffer]] internal slot, then run these steps:

<ol>
<li><p>Set <var>arrayBuffer</var> to the value of <var>arrayBuffer</var>’s \[[ViewedArrayBuffer]]
internal slot.

<li><p>If <var>arrayBuffer</var> is undefined, then return a new promise rejected with a
{{TypeError}} exception.
</ol>

<li><p>If <var>arrayBuffer</var> does not have an \[[ArrayBufferData]] internal slot, or
<a abstract-op>IsDetachedBuffer</a>(<var>arrayBuffer</var>) is true, or
<a abstract-op>IsSharedArrayBuffer</a>(<var>arrayBuffer</var>) is true, then return a new promise
rejected with a {{TypeError}} exception.

<li><p><a>Push</a> a <a lt="get a copy of the buffer source">copy of</a> <var>chunk</var> to
<var>dec</var>'s <a for=TextDecoderStream>stream</a>.
Expand Down

0 comments on commit 6a65ad5

Please sign in to comment.