Re: [whatwg/streams] Rewrite to use Web IDL, and generally modernize (#1035)

@ricea commented on this pull request.



> +      return promiseRejectedWith(readerLockException('cancel'));
+    }
+
+    return aos.ReadableStreamReaderGenericCancel(this, reason);
+  }
+
+  read(view) {
+    if (view.byteLength === 0) {
+      return promiseRejectedWith(new TypeError('view must have non-zero byteLength'));
+    }
+    if (view.buffer.byteLength === 0) {
+      return promiseRejectedWith(new TypeError('view\'s buffer must have non-zero byteLength'));
+    }
+
+    if (this._ownerReadableStream === undefined) {
+      return promiseRejectedWith(readerLockException('cancel'));

```suggestion
      return promiseRejectedWith(readerLockException('read'));
```

-- 
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/1035#pullrequestreview-397739210

Received on Tuesday, 21 April 2020 23:15:02 UTC