Skip to content

stream: improve `ArrayBufferView` validation in `respondWithNewView()`

  • 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

Merge request reports

Loading