node icon indicating copy to clipboard operation
node copied to clipboard

stream: improve view validation on `ReadableStreamBYOBRequest.respondWithNewView()`

Open daeyeon opened this issue 1 year ago • 3 comments

  • This throws if the view is zero-length when there is an active reader when using ReadableStreamBYOBRequest.respondWithNewView().

  • By doing that, we can get all tests passed in wpt/streams/readable-byte-streams/bad-buffers-and-views.any.js.

Refs: https://streams.spec.whatwg.org/#readable-byte-stream-controller-respond-with-new-view

  1. If state is "closed" 5.1. If view.[[ByteLength]] is not 0, throw a TypeError exception.
  2. Otherwise, 6.1 Assert: state is "readable". 6.2 If view.[[ByteLength]] is 0, throw a TypeError exception.

Signed-off-by: Daeyeon Jeong [email protected]

daeyeon avatar Aug 06 '22 17:08 daeyeon

CI: https://ci.nodejs.org/job/node-test-pull-request/45886/

nodejs-github-bot avatar Aug 06 '22 19:08 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/45897/

nodejs-github-bot avatar Aug 07 '22 09:08 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/45909/

nodejs-github-bot avatar Aug 08 '22 01:08 nodejs-github-bot

Rebased since test/wpt/status/streams.json is updated in https://github.com/nodejs/node/pull/43455.

daeyeon avatar Aug 11 '22 01:08 daeyeon

CI: https://ci.nodejs.org/job/node-test-pull-request/45991/

nodejs-github-bot avatar Aug 11 '22 01:08 nodejs-github-bot

Commit Queue failed
- Loading data for nodejs/node/pull/44155
✔  Done loading data for nodejs/node/pull/44155
----------------------------------- PR info ------------------------------------
Title      stream: improve view validation on `ReadableStreamBYOBRequest.respondWithNewView()` (#44155)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     daeyeon:main.webstream-220806.Sat.5609 -> nodejs:main
Labels     author ready, needs-ci, web streams
Commits    1
 - stream: improve views validation on `BYOBRequest`
Committers 1
 - Daeyeon Jeong 
PR-URL: https://github.com/nodejs/node/pull/44155
Refs: https://streams.spec.whatwg.org/#readable-byte-stream-controller-respond-with-new-view
Reviewed-By: Luigi Pinca 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/44155
Refs: https://streams.spec.whatwg.org/#readable-byte-stream-controller-respond-with-new-view
Reviewed-By: Luigi Pinca 
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last review:
   ⚠  - stream: improve views validation on `BYOBRequest`
   ℹ  This PR was created on Sat, 06 Aug 2022 17:16:39 GMT
   ✔  Approvals: 1
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/44155#pullrequestreview-1064334855
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2022-08-11T01:31:42Z: https://ci.nodejs.org/job/node-test-pull-request/45991/
- Querying data for job/node-test-pull-request/45991/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/2862673144

nodejs-github-bot avatar Aug 15 '22 18:08 nodejs-github-bot

Landed in 46f6d225af493adf63ab17912a916dfb843d2970

nodejs-github-bot avatar Aug 15 '22 18:08 nodejs-github-bot

Depends on https://github.com/nodejs/node/pull/43455

juanarbol avatar Oct 03 '22 02:10 juanarbol