Skip to content

stream: improve ArrayBufferView validation in respondWithNewView()#43866

Merged
nodejs-github-bot merged 5 commits intonodejs:mainfrom
daeyeon:main.webstream-220716.Sat.260d
Jul 24, 2022
Merged

stream: improve ArrayBufferView validation in respondWithNewView()#43866
nodejs-github-bot merged 5 commits intonodejs:mainfrom
daeyeon:main.webstream-220716.Sat.260d

Conversation

@daeyeon
Copy link
Member

@daeyeon daeyeon commented Jul 16, 2022

  • This improves the web stream compatibility of the respondWithNewView(view) on ReadableStreamBYOBRequest.
  • Two WPT tests in 'readable-byte-streams/bad-buffers-and-views.any.js' will be passed with this fix.

  1. If ! IsDetachedBuffer(view.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.

- In order to do the IsDetachedBuffer(), I added a new function, ArrayBufferIsDetached(), by referring to the napi_is_detached_arraybuffer().

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. experimental Issues and PRs related to experimental features. needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. web streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants