[whatwg/streams] doc: Fix some variable, properties and function references. (#442)

`index.bs` contains some reference errors, where the wrong variables are used
in describing algorithm steps. Additionally, there's one step that uses an
outside function for a different class.

### List of changes

* * *

[3.7.5 ReadableStreamReaderGenericRelease( reader )](https://streams.spec.whatwg.org/#readable-stream-reader-release)
steps `1-2` should be inverted. Current:
> 1\. Assert: reader@[[ownerReadableStream]]@[[reader]] is not undefined.
> 2\. Assert: reader@[[ownerReadableStream]] is not undefined.

should read:
> 1\. Assert: reader@[[ownerReadableStream]] is not undefined.
> 2\. Assert: reader@[[ownerReadableStream]]@[[reader]] is not undefined.

_**Reason**: Attempting to read `[[reader]]` of `undefined` will throw an unexpected exception._
* * *

[3.8.3 new ReadableStreamDefaultController()](https://streams.spec.whatwg.org/#rs-default-controller-constructor)
step `12.b.i`
> i\. If this@[[state]] is "readable", perform ReadableStreamDefaultControllerError(controller, r).

should read
> i\. If stream@[[state]] is "readable", perform ReadableStreamDefaultControllerError(controller, r).

* * *

[3.8.4.2. close()](https://streams.spec.whatwg.org/#rs-default-controller-close)
step `2`
> 2\. If stream@[[closeRequested]] is true, throw a TypeError exception.

should read
> 2\. If this@[[closeRequested]] is true, throw a TypeError exception.

* * *

[3.8.4.3. enqueue(chunk)](https://streams.spec.whatwg.org/#rs-default-controller-enqueue)
step `2`
> 2\. If stream@[[closeRequested]] is true, throw a TypeError exception.

should read
> 2\. If this@[[closeRequested]] is true, throw a TypeError exception.

* * *

[3.9.2. ReadableStreamDefaultControllerCallPullIfNeeded](https://streams.spec.whatwg.org/#readable-stream-default-controller-call-pull-if-needed)
step `6.b.ii`
> ii\. Perform ReadableStreamDefaultControllerCallPullIfNeeded(stream).

should read
> ii\. Perform ReadableStreamDefaultControllerCallPullIfNeeded(controller).

* * *

[3.9.2. ReadableStreamDefaultControllerCallPullIfNeeded](https://streams.spec.whatwg.org/#readable-stream-default-controller-call-pull-if-needed)
step `7.a`
> a\. If stream@[[state]] is "readable", perform ReadableStreamDefaultControllerError(controller, e).

should read
> a\. If controller@[[controlledReadableStream]@[[state]] is "readable", perform ReadableStreamDefaultControllerError(controller, e).

_**Reason**: `stream` is not defined._

* * *

[3.10.1. Class Definition](https://streams.spec.whatwg.org/#rbs-controller-class-definition)
the JavaScript syntax
```javascript
class ReadableByteStreamController {
  constructor(stream)
```

should read
```javascript
class ReadableByteStreamController {
  constructor(stream, underlyingByteSource, highWaterMark)
```

* * *

[3.10.3. new ReadableByteStreamController()](https://streams.spec.whatwg.org/#rbs-controller-constructor)
step `18.b.i`
> i\. If this@[[state]] is "readable", perform ReadableByteStreamControllerError(controller, r).

should read
> i\. If stream@[[state]] is "readable", perform ReadableByteStreamControllerError(controller, r).

* * *

[3.10.5.2. [[Pull]]()](https://streams.spec.whatwg.org/#rbs-controller-private-pull) 
step `5`
> 5\. Perform ReadableStreamDefaultControllerCallPullIfNeeded(this)

should read
> 5\. Perform ReadableByteStreamControllerCallPullIfNeeded(this)

_**Reason**: `this` is a `ReadableByteStreamController` instance._

* * *

[3.11.1. Class Definition](https://streams.spec.whatwg.org/#rs-byob-request-class-definition)
the JavaScript syntax
```javascript
  constructor(controller, descriptor)
```

should read
```javascript
  constructor(controller, view)
```

* * *

[3.12.6. ReadableByteStreamControllerCommitPullIntoDescriptor](https://streams.spec.whatwg.org/#readable-byte-stream-controller-commit-pull-into-descriptor)
step `2`
> 2\. Let byteOffset be readIntoRequest.[[byteOffset]].

should be removed. _**Reason**: not used anywhere in algorithm._

* * *

[3.12.8. ReadableByteStreamControllerEnqueue](https://streams.spec.whatwg.org/#readable-byte-stream-controller-enqueue)
step `3`
> 3\. Assert: controller@[[state]] is "readable".

should read
> 3\. Assert: stream@[[state]] is "readable".
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/streams/pull/442

-- Commit Summary --

  * doc: Fix some variable, properties and function references.

-- File Changes --

    M index.bs (23)

-- Patch Links --

https://github.com/whatwg/streams/pull/442.patch
https://github.com/whatwg/streams/pull/442.diff

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/442

Received on Saturday, 23 April 2016 09:06:31 UTC